Commit 11c4a211 by zhaoxiaolei

必填校验

parent 29b681c6
package cn.com.uitech.authorization.controller; package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.annotation.BathUpdate;
import cn.com.uitech.authorization.annotation.EditSave; import cn.com.uitech.authorization.annotation.EditSave;
import cn.com.uitech.authorization.annotation.Query; import cn.com.uitech.authorization.annotation.Query;
import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto;
import cn.com.uitech.authorization.pojo.entity.Characteristic; import cn.com.uitech.authorization.pojo.entity.Characteristic;
import cn.com.uitech.authorization.service.CharacteristicService; import cn.com.uitech.authorization.service.CharacteristicService;
import cn.com.uitech.authorization.service.SecurityService; import cn.com.uitech.authorization.service.SecurityService;
...@@ -99,5 +101,13 @@ public class CharacteristicController { ...@@ -99,5 +101,13 @@ public class CharacteristicController {
return ResultGenerator.genSuccessResult(characteristicService.getCharacteristicAll(characteristicRequestParamDto)); return ResultGenerator.genSuccessResult(characteristicService.getCharacteristicAll(characteristicRequestParamDto));
} }
@PutMapping("/updateCharacteristicIsH3C")
@ApiOperation(value = "特征管理 批量更新H3C状态", notes = "特征管理 批量更新H3C状态", httpMethod = "PUT")
public CrmResponseEntity<?> updateCharacteristicValueIsH3C(@Validated({BathUpdate.class}) @RequestBody CharacteristicRequestParamDto dto) {
String code = SecurityService.getPrincipal().getCode();
logger.info("基础信息特征管理维护 批量更新H3C状态 ,操作人:{},物料:{}",code,dto.getCharacteristicCodes().toString());
return ResultGenerator.genSuccessResult(characteristicService.updateCharacteristicIsH3C(dto));
}
} }
...@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.mapper; ...@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.dto.ApplySkuCodeResultDto; import cn.com.uitech.authorization.pojo.dto.ApplySkuCodeResultDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto;
import cn.com.uitech.authorization.pojo.entity.*; import cn.com.uitech.authorization.pojo.entity.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import tk.mybatis.mapper.common.special.InsertListMapper; import tk.mybatis.mapper.common.special.InsertListMapper;
...@@ -86,4 +87,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser ...@@ -86,4 +87,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data); void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data);
void updateSuperBomSku(SuperBomSkuInfo superBomSkuInfo); void updateSuperBomSku(SuperBomSkuInfo superBomSkuInfo);
Integer updateCharacteristicIsH3C(CharacteristicRequestParamDto dto);
} }
...@@ -56,6 +56,9 @@ public class CharacteristicRequestParamDto extends BasePageDto implements Seria ...@@ -56,6 +56,9 @@ public class CharacteristicRequestParamDto extends BasePageDto implements Seria
@ApiModelProperty(name = "isHidden",value = "C显示隐藏",dataType ="Integer") @ApiModelProperty(name = "isHidden",value = "C显示隐藏",dataType ="Integer")
private Integer isHidden; private Integer isHidden;
@ApiModelProperty(name = "isH3C",value = "isH3C",dataType ="Integer")
private Integer isH3C;
/** /**
* 批量更新接口 * 批量更新接口
*/ */
......
...@@ -60,6 +60,9 @@ public class Characteristic implements Serializable{ ...@@ -60,6 +60,9 @@ public class Characteristic implements Serializable{
@Column(name="is_hidden") @Column(name="is_hidden")
@ApiModelProperty(name = "isHidden",value = "是否隐藏",dataType ="Integer",example = "1/0") @ApiModelProperty(name = "isHidden",value = "是否隐藏",dataType ="Integer",example = "1/0")
private Integer isHidden; private Integer isHidden;
@Column(name="is_h3c")
@ApiModelProperty(name = "isH3C",value = "isH3C",dataType ="Integer",example = "1/0")
private Integer isH3C;
@Transient @Transient
......
...@@ -97,6 +97,10 @@ public class CharacteristicValue extends BasePageDto implements Serializable{ ...@@ -97,6 +97,10 @@ public class CharacteristicValue extends BasePageDto implements Serializable{
@ApiModelProperty(name = "h3cDeliverCode",value = "H3C交付代码",dataType ="String") @ApiModelProperty(name = "h3cDeliverCode",value = "H3C交付代码",dataType ="String")
private String h3cDeliverCode; private String h3cDeliverCode;
@Column(name="is_h3c")
@ApiModelProperty(name = "isH3C",value = "特征列表是否H3C",dataType ="Integer")
private Integer isH3C;
@Transient @Transient
@ApiModelProperty(name = "bomStatus",value = "物料状态",dataType ="String") @ApiModelProperty(name = "bomStatus",value = "物料状态",dataType ="String")
private String bomStatus; private String bomStatus;
......
...@@ -2,6 +2,7 @@ package cn.com.uitech.authorization.service; ...@@ -2,6 +2,7 @@ package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.CharacteristicDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto;
import cn.com.uitech.authorization.pojo.entity.Characteristic; import cn.com.uitech.authorization.pojo.entity.Characteristic;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -51,4 +52,7 @@ public interface CharacteristicService { ...@@ -51,4 +52,7 @@ public interface CharacteristicService {
void insertList(List<Characteristic> characteristics); void insertList(List<Characteristic> characteristics);
Object updateCharacteristicIsH3C(CharacteristicRequestParamDto dto);
} }
...@@ -143,4 +143,9 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -143,4 +143,9 @@ public class CharacteristicServiceImpl implements CharacteristicService {
} }
} }
} }
@Override
public Object updateCharacteristicIsH3C(CharacteristicRequestParamDto dto) {
return characteristicMapper.updateCharacteristicIsH3C(dto);
}
} }
...@@ -353,6 +353,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -353,6 +353,8 @@ public class IntegrateServiceImpl implements IntegrateService {
GetProductOutDto result = new GetProductOutDto(); GetProductOutDto result = new GetProductOutDto();
if (!ObjectUtils.isEmpty(superBomSkuInfo)) { if (!ObjectUtils.isEmpty(superBomSkuInfo)) {
//根据 政采 模式 品牌 superbom 查询sku主信息 //根据 政采 模式 品牌 superbom 查询sku主信息
if(superBomSkuInfo.getPoliticalMiningId()!=null &&superBomSkuInfo.getPatern()!=null &&superBomSkuInfo.getSuperBomCode()!=null &&superBomSkuInfo.getBrand()!=null){
List<SuperBomSkuInfo> skuInfos = superBomSkuInfoMapper.getSkuInfo(superBomSkuInfo); List<SuperBomSkuInfo> skuInfos = superBomSkuInfoMapper.getSkuInfo(superBomSkuInfo);
Boolean flag = true; Boolean flag = true;
if (!CollectionUtils.isEmpty(skuInfos)) { if (!CollectionUtils.isEmpty(skuInfos)) {
...@@ -415,7 +417,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -415,7 +417,7 @@ public class IntegrateServiceImpl implements IntegrateService {
} }
//撞配不通过 保存SKU信息&config信息 调用申请SKU接口 applySkuCode //撞配不通过 保存SKU信息&config信息 调用申请SKU接口 applySkuCode
if (flag.equals(true)) { if (flag.equals(false)) {
superBomSkuInfo.setId(sequence.nextId()); superBomSkuInfo.setId(sequence.nextId());
superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo); superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo);
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList(); List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
...@@ -460,9 +462,16 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -460,9 +462,16 @@ public class IntegrateServiceImpl implements IntegrateService {
} }
}else{
result.setMsg("是否政采/模式/产品编码/品牌是否,不能为空!");
result.setCode(500);
result.setData(superBomSkuInfo);
return result;
}
} }
return result; return result;
} }
@Override @Override
...@@ -481,10 +490,12 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -481,10 +490,12 @@ public class IntegrateServiceImpl implements IntegrateService {
JSONObject data = (JSONObject) map.get("data"); JSONObject data = (JSONObject) map.get("data");
result.setCode(200); result.setCode(200);
result.setData(data); result.setData(data);
}else{
result.setCode(code);
result.setMsg((String) map.get("msg"));
result.setData(superBomSkuInfo);
} }
//superBomSkuInfo.setSkuCode(getSkuInfo.getSkuCode()); return result;
//superBomSkuInfo.setSkuName(getSkuInfo.getSkuName());
return ob;
}else{ }else{
GetProductOutDto ss = (GetProductOutDto)ob; GetProductOutDto ss = (GetProductOutDto)ob;
result.setCode(ss.getCode()); result.setCode(ss.getCode());
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
unis_Sales_C_Name =#{unisSalesCName}, unis_Sales_C_Name =#{unisSalesCName},
characteristic_type =#{characteristicType}, characteristic_type =#{characteristicType},
h3c_c_code =#{H3CCCode}, h3c_c_code =#{H3CCCode},
is_hidden =#{isHidden} is_hidden =#{isHidden},
is_h3c =#{isH3C}
where where
Characteristic_Code=#{characteristicCode} Characteristic_Code=#{characteristicCode}
</update> </update>
...@@ -193,4 +194,17 @@ ...@@ -193,4 +194,17 @@
<update id="updateSuperBomSku"> <update id="updateSuperBomSku">
update super_bom_sku_info set apply_status = #{description} where config_id = #{configId} update super_bom_sku_info set apply_status = #{description} where config_id = #{configId}
</update> </update>
<update id="updateCharacteristicIsH3C">
update super_characteristic_info set is_h3c = #{isH3C}
<where>
<if test="characteristicCodes!=null">
characteristic_Code IN
<foreach collection="characteristicCodes" item="characteristicCode" open="(" separator=","
close=")">
#{characteristicCode}
</foreach>
</if>
</where>
</update>
</mapper> </mapper>
...@@ -92,16 +92,19 @@ ...@@ -92,16 +92,19 @@
<if test="superBomCode != null and superBomCode != ''.toString()"> <if test="superBomCode != null and superBomCode != ''.toString()">
a.super_bom_code = #{superBomCode} a.super_bom_code = #{superBomCode}
</if> </if>
<if test="characteristicName != null and characteristicName != ''.toString()"> <if test="characteristicValueName != null and characteristicValueName != ''.toString()">
and b.characteristic_name = #{characteristicName} and c.characteristic_value_name = #{characteristicValueName}
</if>
<if test="characteristicValueCode != null and characteristicValueCode != ''.toString()">
and c.characteristic_value_code = #{characteristicValueCode}
</if> </if>
<if test="characteristicCode != null and characteristicCode != ''.toString()"> <if test="characteristicCode != null and characteristicCode != ''.toString()">
and b.characteristic_code = #{characteristicCode} and b.characteristic_code = #{characteristicCode}
</if> </if>
<if test="isState != null and isState != ''.toString()"> <if test="isState != null">
and c.is_state = #{isState} and c.is_state = #{isState}
</if> </if>
<if test="superBomIsState != null and superBomIsState != ''.toString()"> <if test="superBomIsState != null ">
and a.is_state = #{superBomIsState} and a.is_state = #{superBomIsState}
</if> </if>
<if test="brand != null and brand != ''.toString()"> <if test="brand != null and brand != ''.toString()">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment