|
@@ -11,9 +11,11 @@ import com.iotechn.unimall.core.exception.AdminServiceException;
|
|
|
import com.iotechn.unimall.core.exception.ExceptionDefinition;
|
|
|
import com.iotechn.unimall.core.exception.ServiceException;
|
|
|
import com.iotechn.unimall.data.domain.CollectionPaymentDO;
|
|
|
+import com.iotechn.unimall.data.domain.CustomerInfoDO;
|
|
|
import com.iotechn.unimall.data.dto.CollectionPaymentDTO;
|
|
|
import com.iotechn.unimall.data.dto.CollectionPaymentTiDTO;
|
|
|
import com.iotechn.unimall.data.mapper.CollectionPaymentMapper;
|
|
|
+import com.iotechn.unimall.data.mapper.CustomerInfoMapper;
|
|
|
import com.iotechn.unimall.data.model.Page;
|
|
|
import com.iotechn.unimall.data.util.ExcelUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -51,6 +53,8 @@ public class CollectionPaymentServiceImpl implements CollectionPaymentService {
|
|
|
|
|
|
@Autowired
|
|
|
private CollectionPaymentMapper collectionPaymentMapper;
|
|
|
+ @Autowired
|
|
|
+ private CustomerInfoMapper customerInfoMapper;
|
|
|
@Value("C://file//crew/")
|
|
|
private String localPath;
|
|
|
|
|
@@ -86,7 +90,7 @@ public class CollectionPaymentServiceImpl implements CollectionPaymentService {
|
|
|
wrapper.and("DATE_FORMAT(receipt_payment_date,'%Y%m%d') <= DATE_FORMAT('" + selectDTO.getEndDate() + "','%Y%m%d')");
|
|
|
|
|
|
}
|
|
|
- wrapper.orderBy("receipt_payment_date",false);
|
|
|
+ wrapper.orderBy("receipt_payment_date", false);
|
|
|
|
|
|
List<CollectionPaymentDO> list = collectionPaymentMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
|
|
|
// for (int i=0;i<list.size();i++){
|
|
@@ -107,6 +111,17 @@ public class CollectionPaymentServiceImpl implements CollectionPaymentService {
|
|
|
insertDO.setStatus(0);
|
|
|
insertDO.setPayNo(getlinkNo());
|
|
|
if (collectionPaymentMapper.insert(insertDO) > 0) {
|
|
|
+ if ("1".equalsIgnoreCase(insertDO.getBusinessType())) {
|
|
|
+ // 客户已付联动
|
|
|
+ CustomerInfoDO customerInfoDO1 = new CustomerInfoDO();
|
|
|
+ customerInfoDO1.setCustomer(insertDO.getReceivingWithdrawingPeople());
|
|
|
+ CustomerInfoDO customerInfoDO = customerInfoMapper.selectOne(customerInfoDO1);
|
|
|
+ if (customerInfoDO != null) {
|
|
|
+ customerInfoDO.setYiAmount(customerInfoDO.getYiAmount()+insertDO.getDeductionEuro());
|
|
|
+ }
|
|
|
+ customerInfoMapper.updateById(customerInfoDO);
|
|
|
+ }
|
|
|
+
|
|
|
return insertDO;
|
|
|
}
|
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
@@ -156,7 +171,7 @@ public class CollectionPaymentServiceImpl implements CollectionPaymentService {
|
|
|
CollectionPaymentDO updateDO = new CollectionPaymentDO();
|
|
|
BeanUtils.copyProperties(editDTO, updateDO);
|
|
|
updateDO.setGmtUpdate(now);
|
|
|
- if("1".equals(editDTO.getFlag())){
|
|
|
+ if ("1".equals(editDTO.getFlag())) {
|
|
|
updateDO.setStatus(1);
|
|
|
}
|
|
|
|
|
@@ -219,8 +234,8 @@ public class CollectionPaymentServiceImpl implements CollectionPaymentService {
|
|
|
|
|
|
CollectionPaymentDTO collectionPaymentDTO2 = new CollectionPaymentDTO();
|
|
|
collectionPaymentDTO2.setType("jing");
|
|
|
- collectionPaymentDTO2.setDeductionEurotj(shouMoneyo-fuMoneyo);
|
|
|
- collectionPaymentDTO2.setDeductionRmbtj(shouMoneyrmb-fuMoneyrmb);
|
|
|
+ collectionPaymentDTO2.setDeductionEurotj(shouMoneyo - fuMoneyo);
|
|
|
+ collectionPaymentDTO2.setDeductionRmbtj(shouMoneyrmb - fuMoneyrmb);
|
|
|
collectionPaymentDTOS.add(collectionPaymentDTO2);
|
|
|
return collectionPaymentDTOS;
|
|
|
}
|