guoyuji
2024-09-24 2f9b500fb9f81fb4d74d7156097f72bae7f6b0cb
north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
@@ -7,9 +7,11 @@
import com.example.erp.dto.sd.DeliveryDetailDTO;
import com.example.erp.dto.sd.DeliveryDetailProductDTO;
import com.example.erp.entity.sd.*;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.mapper.mm.FinishedGoodsInventoryMapper;
import com.example.erp.mapper.sd.*;
import com.example.erp.service.userInfo.LogService;
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,6 +30,8 @@
    CustomerMapper customerMapper;
    @Autowired
    SysErrorService sysErrorService;
    @Autowired
    LogService logService;
    public Map<String, Object> getSelectCustomer(Integer pageNum, Integer pageSize, Customer customer) {
@@ -42,6 +46,8 @@
    public Boolean insertCustomer(Map<String,Object> object) {
        boolean saveState = true;
        Log log = new Log();
        log.setContent(object.toString());
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
@@ -49,9 +55,12 @@
           if(customer!=null){
               if (customer.getId()!=null && customer.getId()!=0){
                   customerMapper.updateCustomer(customer);
                   log.setFunction("insertCustomer修改");
               }else{
                   customerMapper.insertCustomer(customer);
                   log.setFunction("insertCustomer新增");
               }
               logService.saveLog(log);
           }
@@ -79,6 +88,10 @@
                if (customer.getId()!=null){
                    customerMapper.deleteCustomer(customer);
                }
                Log log = new Log();
                log.setContent(object.toString());
                log.setFunction("deleteCustomer删除");
                logService.saveLog(log);
            }