解决条码长度超长的问题
This commit is contained in:
@@ -20,4 +20,6 @@ public interface MaterialExtendMapperEx {
|
||||
@Param("syncNum") Long syncNum);
|
||||
|
||||
List<MaterialExtend> getListByMId(@Param("ids") Long ids[]);
|
||||
|
||||
int batchDeleteMaterialExtendByMIds(@Param("ids") String ids[]);
|
||||
}
|
||||
@@ -268,62 +268,4 @@ public class MaterialExtendService {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条码更新零售价
|
||||
* @param retailPrice
|
||||
* @param barCode
|
||||
*/
|
||||
public int updateRetailPriceByCode(BigDecimal retailPrice,String barCode) {
|
||||
int result=0;
|
||||
try{
|
||||
MaterialExtend materialExtend = new MaterialExtend();
|
||||
materialExtend.setCommodityDecimal(retailPrice);
|
||||
MaterialExtendExample example = new MaterialExtendExample();
|
||||
example.createCriteria().andBarCodeEqualTo(barCode);
|
||||
result = materialExtendMapper.updateByExampleSelective(materialExtend, example);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条码更新进价
|
||||
* @param purchasePrice
|
||||
* @param barCode
|
||||
*/
|
||||
public int updatePurchasePriceByCode(BigDecimal purchasePrice,String barCode) {
|
||||
int result=0;
|
||||
try{
|
||||
MaterialExtend materialExtend = new MaterialExtend();
|
||||
materialExtend.setPurchaseDecimal(purchasePrice);
|
||||
MaterialExtendExample example = new MaterialExtendExample();
|
||||
example.createCriteria().andBarCodeEqualTo(barCode);
|
||||
result = materialExtendMapper.updateByExampleSelective(materialExtend, example);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条码更新进价
|
||||
* @param barCode
|
||||
* @param barCode
|
||||
*/
|
||||
public MaterialExtend getMaterialExtendByBarCode(String barCode) {
|
||||
MaterialExtend me = new MaterialExtend();
|
||||
try{
|
||||
MaterialExtendExample example = new MaterialExtendExample();
|
||||
example.createCriteria().andBarCodeEqualTo(barCode);
|
||||
List<MaterialExtend> list = materialExtendMapper.selectByExample(example);
|
||||
if(list!=null && list.size()>0) {
|
||||
me = list.get(0);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return me;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapper;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.MaterialStockMapper;
|
||||
import com.jsh.erp.datasource.mappers.*;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.MaterialExtend.MaterialExtendService;
|
||||
@@ -45,6 +42,8 @@ public class MaterialService {
|
||||
@Resource
|
||||
private MaterialMapperEx materialMapperEx;
|
||||
@Resource
|
||||
private MaterialExtendMapperEx materialExtendMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@@ -603,13 +602,16 @@ public class MaterialService {
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
int result =0;
|
||||
try{
|
||||
result= materialMapperEx.batchDeleteMaterialByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
//逻辑删除商品
|
||||
materialMapperEx.batchDeleteMaterialByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
//逻辑删除商品价格扩展
|
||||
materialExtendMapperEx.batchDeleteMaterialExtendByMIds(idArray);
|
||||
return 1;
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
return 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
|
||||
Reference in New Issue
Block a user