|
@@ -10,6 +10,7 @@ import com.gqy.document.service.IDcProductService;
|
|
|
import com.gqy.system.mapper.DcPsParamMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -89,9 +90,6 @@ public class DcProductServiceImpl implements IDcProductService {
|
|
|
// 规格管理
|
|
|
List<Map> specs = (List<Map>) params.get("specs");
|
|
|
for (Map maps : specs) {
|
|
|
- // 规格
|
|
|
-
|
|
|
-
|
|
|
|
|
|
//保存规格信息表
|
|
|
DcSpec dcSpec = new DcSpec();
|
|
@@ -104,15 +102,17 @@ public class DcProductServiceImpl implements IDcProductService {
|
|
|
|
|
|
dcSpecMapper.insertDcSpec(dcSpec);
|
|
|
|
|
|
- //规格参数
|
|
|
- DcPsParam dcPsParam = new DcPsParam();
|
|
|
- BeanUtils.mapToBean(maps,dcPsParam );
|
|
|
- dcPsParam.setPsp_mode(ps_no);
|
|
|
-
|
|
|
- dcPsParamMapper.insertDcPsParam(dcPsParam);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ //查询 规格参数
|
|
|
+ DcPsParam dcPsParamQuery = new DcPsParam();
|
|
|
+ dcPsParamQuery.setPsp_mode(ps_no);
|
|
|
+ List<DcPsParam> listDcPsParam = dcPsParamMapper.selectDcPsParamList(dcPsParamQuery);
|
|
|
+ if(CollectionUtils.isEmpty(listDcPsParam)){
|
|
|
+ //规格参数
|
|
|
+ DcPsParam dcPsParam = new DcPsParam();
|
|
|
+ BeanUtils.mapToBean(maps,dcPsParam );
|
|
|
+ dcPsParam.setPsp_mode(ps_no);
|
|
|
+ dcPsParamMapper.insertDcPsParam(dcPsParam);
|
|
|
+ }
|
|
|
}
|
|
|
return 1;
|
|
|
}catch (Exception e){
|