解决条码长度超长的问题
This commit is contained in:
@@ -1606,6 +1606,7 @@
|
||||
function CheckData() {
|
||||
var row = $('#materialExtendData').datagrid('getRows');
|
||||
var totalRowNum = "";
|
||||
var totalBarCodeOverNum = "";
|
||||
for (var i = 0; i < row.length; i++) {
|
||||
if (row[i].BarCode == "") {
|
||||
totalRowNum += (i + 1) + "、";
|
||||
@@ -1613,12 +1614,20 @@
|
||||
if (row[i].CommodityUnit == "") {
|
||||
totalRowNum += (i + 1) + "、";
|
||||
}
|
||||
if (row[i].BarCode.length > 15) {
|
||||
totalBarCodeOverNum += (i + 1) + "、";
|
||||
}
|
||||
}
|
||||
if (totalRowNum != "") {
|
||||
var totalRowNum = totalRowNum.substring(0, totalRowNum.length - 1);
|
||||
$.messager.alert('提示',"第" + totalRowNum + "行数据填写不完整!",'info');
|
||||
return false;
|
||||
}
|
||||
if (totalBarCodeOverNum != "") {
|
||||
var totalBarCodeOverNum = totalBarCodeOverNum.substring(0, totalBarCodeOverNum.length - 1);
|
||||
$.messager.alert('提示',"第" + totalBarCodeOverNum + "行条码长度超过15位!",'info');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -53,4 +53,16 @@
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<update id="batchDeleteMaterialExtendByMIds">
|
||||
update jsh_material_extend
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
and material_id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -219,6 +219,8 @@
|
||||
|
||||
<select id="getMaxBarCode" resultType="java.lang.String">
|
||||
select max(CAST(l.bar_code AS SIGNED)) bar_code from jsh_material_extend l
|
||||
where 1=1
|
||||
and ifnull(l.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getMaterialByMeId" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
|
||||
Reference in New Issue
Block a user