初步给商品的扩展信息拆分成扩展1 扩展2 扩展3
This commit is contained in:
@@ -94,7 +94,9 @@ public class MaterialController extends BaseController {
|
||||
String color = StringUtil.getInfo(search, "color");
|
||||
String brand = StringUtil.getInfo(search, "brand");
|
||||
String mfrs = StringUtil.getInfo(search, "mfrs");
|
||||
String materialOther = StringUtil.getInfo(search, "materialOther");
|
||||
String otherField1 = StringUtil.getInfo(search, "otherField1");
|
||||
String otherField2 = StringUtil.getInfo(search, "otherField2");
|
||||
String otherField3 = StringUtil.getInfo(search, "otherField3");
|
||||
String weight = StringUtil.getInfo(search, "weight");
|
||||
String expiryNum = StringUtil.getInfo(search, "expiryNum");
|
||||
String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber");
|
||||
@@ -103,8 +105,8 @@ public class MaterialController extends BaseController {
|
||||
String enabled = StringUtil.getInfo(search, "enabled");
|
||||
String remark = StringUtil.getInfo(search, "remark");
|
||||
String mpList = StringUtil.getInfo(search, "mpList");
|
||||
List<MaterialVo4Unit> list = materialService.select(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
|
||||
enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList);
|
||||
List<MaterialVo4Unit> list = materialService.select(materialParam, standard, model, color, brand, mfrs, otherField1, otherField2,
|
||||
otherField3, weight, expiryNum, enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -304,6 +306,9 @@ public class MaterialController extends BaseController {
|
||||
@RequestParam(value = "color", required = false) String color,
|
||||
@RequestParam(value = "brand", required = false) String brand,
|
||||
@RequestParam(value = "mfrs", required = false) String mfrs,
|
||||
@RequestParam(value = "otherField1", required = false) String otherField1,
|
||||
@RequestParam(value = "otherField2", required = false) String otherField2,
|
||||
@RequestParam(value = "otherField3", required = false) String otherField3,
|
||||
@RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber,
|
||||
@RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber,
|
||||
@RequestParam("page") Integer currentPage,
|
||||
@@ -316,10 +321,11 @@ public class MaterialController extends BaseController {
|
||||
mpArr= mpList.split(",");
|
||||
}
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, StringUtil.toNull(standardOrModel),
|
||||
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), enableSerialNumber, enableBatchNumber,
|
||||
(currentPage-1)*pageSize, pageSize);
|
||||
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), StringUtil.toNull(otherField2), StringUtil.toNull(otherField3),
|
||||
enableSerialNumber, enableBatchNumber, (currentPage-1)*pageSize, pageSize);
|
||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, StringUtil.toNull(standardOrModel),
|
||||
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), enableSerialNumber, enableBatchNumber);
|
||||
StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), StringUtil.toNull(otherField2), StringUtil.toNull(otherField3),
|
||||
enableSerialNumber, enableBatchNumber);
|
||||
object.put("total", total);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
//存放数据json数组
|
||||
@@ -373,6 +379,9 @@ public class MaterialController extends BaseController {
|
||||
}
|
||||
item.put("stock", stock);
|
||||
item.put("expand", materialService.getMaterialOtherByParam(mpArr, material));
|
||||
item.put("otherField1", material.getOtherField1());
|
||||
item.put("otherField2", material.getOtherField2());
|
||||
item.put("otherField3", material.getOtherField3());
|
||||
item.put("imgName", material.getImgName());
|
||||
if(fileUploadType == 2) {
|
||||
item.put("imgSmall", "small");
|
||||
|
||||
@@ -24,7 +24,9 @@ public interface MaterialMapperEx {
|
||||
@Param("color") String color,
|
||||
@Param("brand") String brand,
|
||||
@Param("mfrs") String mfrs,
|
||||
@Param("materialOther") String materialOther,
|
||||
@Param("otherField1") String otherField1,
|
||||
@Param("otherField2") String otherField2,
|
||||
@Param("otherField3") String otherField3,
|
||||
@Param("weight") String weight,
|
||||
@Param("expiryNum") String expiryNum,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@@ -51,6 +53,9 @@ public interface MaterialMapperEx {
|
||||
@Param("color") String color,
|
||||
@Param("brand") String brand,
|
||||
@Param("mfrs") String mfrs,
|
||||
@Param("otherField1") String otherField1,
|
||||
@Param("otherField2") String otherField2,
|
||||
@Param("otherField3") String otherField3,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber,
|
||||
@Param("offset") Integer offset,
|
||||
@@ -62,6 +67,9 @@ public interface MaterialMapperEx {
|
||||
@Param("color") String color,
|
||||
@Param("brand") String brand,
|
||||
@Param("mfrs") String mfrs,
|
||||
@Param("otherField1") String otherField1,
|
||||
@Param("otherField2") String otherField2,
|
||||
@Param("otherField3") String otherField3,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ public class MaterialService {
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
|
||||
String materialOther, String weight, String expiryNum, String enableSerialNumber,
|
||||
String otherField1, String otherField2, String otherField3, String weight, String expiryNum, String enableSerialNumber,
|
||||
String enableBatchNumber, String position, String enabled, String remark, String categoryId,
|
||||
String mpList)
|
||||
throws Exception{
|
||||
@@ -124,7 +124,8 @@ public class MaterialService {
|
||||
idList = getListByParentId(Long.parseLong(categoryId));
|
||||
}
|
||||
PageUtils.startPage();
|
||||
list= materialMapperEx.selectByConditionMaterial(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
|
||||
list= materialMapperEx.selectByConditionMaterial(materialParam, standard, model, color, brand, mfrs,
|
||||
otherField1, otherField2, otherField3, weight, expiryNum,
|
||||
enableSerialNumber, enableBatchNumber, position, enabled, remark, idList, mpList);
|
||||
if (null != list && list.size()>0) {
|
||||
Map<Long,BigDecimal> initialStockMap = getInitialStockMapByMaterialList(list);
|
||||
@@ -416,8 +417,8 @@ public class MaterialService {
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color,
|
||||
String brand, String mfrs, String enableSerialNumber, String enableBatchNumber,
|
||||
Integer offset, Integer rows) throws Exception{
|
||||
String brand, String mfrs, String otherField1, String otherField2, String otherField3,
|
||||
String enableSerialNumber, String enableBatchNumber, Integer offset, Integer rows) throws Exception{
|
||||
List<MaterialVo4Unit> list =null;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -430,7 +431,7 @@ public class MaterialService {
|
||||
q = q.trim();
|
||||
}
|
||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, standardOrModel, color, brand, mfrs,
|
||||
enableSerialNumber, enableBatchNumber, offset, rows);
|
||||
otherField1, otherField2, otherField3, enableSerialNumber, enableBatchNumber, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
@@ -438,7 +439,8 @@ public class MaterialService {
|
||||
}
|
||||
|
||||
public int findBySelectWithBarCodeCount(Long categoryId, String q, String standardOrModel, String color,
|
||||
String brand, String mfrs, String enableSerialNumber, String enableBatchNumber) throws Exception{
|
||||
String brand, String mfrs, String otherField1, String otherField2, String otherField3,
|
||||
String enableSerialNumber, String enableBatchNumber) throws Exception{
|
||||
int result=0;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -450,7 +452,7 @@ public class MaterialService {
|
||||
q = q.replace("'", "");
|
||||
}
|
||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, standardOrModel, color, brand, mfrs,
|
||||
enableSerialNumber, enableBatchNumber);
|
||||
otherField1, otherField2, otherField3, enableSerialNumber, enableBatchNumber);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
|
||||
@@ -70,9 +70,17 @@
|
||||
<bind name="bindMfrs" value="'%'+mfrs+'%'"/>
|
||||
and m.mfrs like #{bindMfrs}
|
||||
</if>
|
||||
<if test="materialOther != null and materialOther !=''">
|
||||
<bind name="bindOther" value="'%'+materialOther+'%'"/>
|
||||
and (m.other_field1 like #{bindOther} or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
|
||||
<if test="otherField1 != null and otherField1 !=''">
|
||||
<bind name="bindOtherField1" value="'%'+otherField1+'%'"/>
|
||||
and m.other_field1 like #{bindOtherField1}
|
||||
</if>
|
||||
<if test="otherField2 != null and otherField2!=''">
|
||||
<bind name="bindOtherField2" value="'%'+otherField2+'%'"/>
|
||||
and m.other_field2 like #{bindOtherField2}
|
||||
</if>
|
||||
<if test="otherField3 != null and otherField3 !=''">
|
||||
<bind name="bindOtherField3" value="'%'+otherField3+'%'"/>
|
||||
and m.other_field3 like #{bindOtherField3}
|
||||
</if>
|
||||
<if test="weight != null and weight !=''">
|
||||
and m.weight = #{weight}
|
||||
@@ -330,6 +338,18 @@
|
||||
<bind name="bindMfrs" value="'%'+mfrs+'%'"/>
|
||||
and m.mfrs like #{bindMfrs}
|
||||
</if>
|
||||
<if test="otherField1 != null and otherField1 !=''">
|
||||
<bind name="bindOtherField1" value="'%'+otherField1+'%'"/>
|
||||
and m.other_field1 like #{bindOtherField1}
|
||||
</if>
|
||||
<if test="otherField2 != null and otherField2!=''">
|
||||
<bind name="bindOtherField2" value="'%'+otherField2+'%'"/>
|
||||
and m.other_field2 like #{bindOtherField2}
|
||||
</if>
|
||||
<if test="otherField3 != null and otherField3 !=''">
|
||||
<bind name="bindOtherField3" value="'%'+otherField3+'%'"/>
|
||||
and m.other_field3 like #{bindOtherField3}
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
@@ -375,6 +395,18 @@
|
||||
<bind name="bindMfrs" value="'%'+mfrs+'%'"/>
|
||||
and m.mfrs like #{bindMfrs}
|
||||
</if>
|
||||
<if test="otherField1 != null and otherField1 !=''">
|
||||
<bind name="bindOtherField1" value="'%'+otherField1+'%'"/>
|
||||
and m.other_field1 like #{bindOtherField1}
|
||||
</if>
|
||||
<if test="otherField2 != null and otherField2!=''">
|
||||
<bind name="bindOtherField2" value="'%'+otherField2+'%'"/>
|
||||
and m.other_field2 like #{bindOtherField2}
|
||||
</if>
|
||||
<if test="otherField3 != null and otherField3 !=''">
|
||||
<bind name="bindOtherField3" value="'%'+otherField3+'%'"/>
|
||||
and m.other_field3 like #{bindOtherField3}
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
|
||||
Reference in New Issue
Block a user