从源更新

This commit is contained in:
qiankunpingtai
2019-05-05 09:33:39 +08:00
40 changed files with 3447 additions and 144 deletions

View File

@@ -316,4 +316,24 @@ public class DepotService {
return deleteTotal;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateDepotIsDefault(Boolean isDefault, Long depotID) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotID,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
Depot depot = new Depot();
depot.setIsDefault(isDefault);
DepotExample example = new DepotExample();
example.createCriteria().andIdEqualTo(depotID);
int result=0;
try{
result = depotMapper.updateByExampleSelective(depot, example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
}

View File

@@ -115,7 +115,9 @@ public class DepotHeadService {
if(dh.getTotalprice() != null) {
dh.setTotalprice(dh.getTotalprice().abs());
}
dh.setOpertimeStr(getCenternTime(dh.getOpertime()));
if(dh.getOpertime() != null) {
dh.setOpertimeStr(getCenternTime(dh.getOpertime()));
}
dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId()));
resList.add(dh);
}

View File

@@ -9,17 +9,16 @@ import com.jsh.erp.datasource.mappers.DepotHeadMapper;
import com.jsh.erp.datasource.mappers.DepotItemMapper;
import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
import com.jsh.erp.datasource.mappers.SerialNumberMapperEx;
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
@@ -32,8 +31,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@Service
public class DepotItemService {
private Logger logger = LoggerFactory.getLogger(DepotItemService.class);
@@ -795,4 +792,32 @@ public class DepotItemService {
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, Integer pid) {
List<DepotItemStockWarningCount> list = null;
try{
list =depotItemMapperEx.findStockWarningCount( offset, rows, pid);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int findStockWarningCountTotal(Integer pid) {
int result = 0;
try{
result =depotItemMapperEx.findStockWarningCountTotal(pid);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return result;
}
}

View File

@@ -120,6 +120,12 @@ public class SupplierService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSupplier(String beanJson, Long id)throws Exception {
Supplier supplier = JSONObject.parseObject(beanJson, Supplier.class);
if(supplier.getBeginneedpay() == null) {
supplier.setBeginneedpay(BigDecimal.ZERO);
}
if(supplier.getBeginneedget() == null) {
supplier.setBeginneedget(BigDecimal.ZERO);
}
supplier.setId(id);
int result=0;
try{