|
|
@@ -119,6 +119,21 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
main.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
List<Vendorcontact> items = vendorListDTO.getItems();
|
|
|
String ve_code = main.getVe_code().trim().toUpperCase();
|
|
|
+
|
|
|
+ //获取已结账的期间
|
|
|
+ String YM = subledgerMapper.selectUnPeriod(companyId);
|
|
|
+ if(YM==null || YM.equals("")){
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMM");
|
|
|
+ YM = simpleDateFormat.format(main.getVe_begindate());
|
|
|
+ }else{
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMM");
|
|
|
+ String beginDate = simpleDateFormat.format(main.getVe_begindate());
|
|
|
+ if(Integer.valueOf(YM)>Integer.valueOf(beginDate)){
|
|
|
+ int code = BizExceptionCode.LIMIT_PERIOD_VENDOR.getCode();
|
|
|
+ String mes = String.format(BizExceptionCode.LIMIT_PERIOD_VENDOR.getMessage(),YM);
|
|
|
+ throw new BizException(code , mes);
|
|
|
+ }
|
|
|
+ }
|
|
|
ve_code = RegexpUtils.replaceSpecCharacter(ve_code);
|
|
|
String code = pushMaxnubmer(ve_code, main.getId());
|
|
|
if(main.getId() == 0){
|
|
|
@@ -237,7 +252,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
subledger.setSl_orderamount(Math.abs(amount));
|
|
|
subledger.setSl_namount(Math.abs(amount));
|
|
|
Long sl_id = subledgerMapper.selectByKindCodeVendid("期初余额","期初余额",
|
|
|
- Math.toIntExact(main.getId()),BaseContextHolder.getCompanyId());
|
|
|
+ Math.toIntExact(main.getId()),BaseContextHolder.getCompanyId(),YM);
|
|
|
subledger.setId(sl_id);
|
|
|
if ( sl_id!=null && sl_id > 0 ) {
|
|
|
subledgerMapper.updateByPrimaryKeySelective(subledger);
|