Commit 9580042c by zhaoxiaolei

调用PLM 成功

parent abf6f689
...@@ -98,7 +98,7 @@ public class IntegrateController { ...@@ -98,7 +98,7 @@ public class IntegrateController {
characteristicValue.put("characteristicName", cName); characteristicValue.put("characteristicName", cName);
String characteristicValueCode = itemInfo.getCharacteristicValueCode(); String characteristicValueCode = itemInfo.getCharacteristicValueCode();
if (!StringUtils.isEmpty(characteristicValueCode)) { if (!StringUtils.isEmpty(characteristicValueCode)) {
String vName = integrateService.getVNameByCode(characteristicValueCode); String vName = integrateService.getVNameByCode(characteristicValueCode,characteristicCode);
values.add(vName); values.add(vName);
} }
featureComponentNames.add(cName); featureComponentNames.add(cName);
...@@ -167,7 +167,7 @@ public class IntegrateController { ...@@ -167,7 +167,7 @@ public class IntegrateController {
String characteristicName = (String) item.get("characteristicName"); String characteristicName = (String) item.get("characteristicName");
Characteristic characteristic = integrateService.findByCharacteristicName(characteristicName, selectorEntity.getSuperBomCode()); Characteristic characteristic = integrateService.findByCharacteristicName(characteristicName, selectorEntity.getSuperBomCode());
String characteristicValueName = (String) item.get("characteristicValueName"); String characteristicValueName = (String) item.get("characteristicValueName");
CharacteristicValue characteristicValue = integrateService.findByCharacteristicValueName(characteristicValueName, selectorEntity.getSuperBomCode()); CharacteristicValue characteristicValue = integrateService.findByCharacteristicValueName(characteristic.getCharacteristicCode(),characteristicValueName, selectorEntity.getSuperBomCode());
selectedValue.put("characteristicCode", characteristic.getCharacteristicCode()); selectedValue.put("characteristicCode", characteristic.getCharacteristicCode());
selectedValue.put("characteristicName", characteristic.getCharacteristicName()); selectedValue.put("characteristicName", characteristic.getCharacteristicName());
selectedValue.put("characteristicValueCode", characteristicValue.getCharacteristicValueCode()); selectedValue.put("characteristicValueCode", characteristicValue.getCharacteristicValueCode());
...@@ -305,5 +305,11 @@ public class IntegrateController { ...@@ -305,5 +305,11 @@ public class IntegrateController {
return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId)); return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId));
} }
@PostMapping("/getToken")
@ApiOperation(value = "获取token", notes = "getToken", httpMethod = "POST")
public CrmResponseEntity<?> getToken(@RequestBody UserInfo userinfo) {
return ResultGenerator.genSuccessResult(integrateService.getToken(userinfo));
}
} }
...@@ -84,4 +84,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser ...@@ -84,4 +84,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto); void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto);
void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data); void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data);
void updateSuperBomSku(SuperBomSkuInfo superBomSkuInfo);
} }
...@@ -94,11 +94,11 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal ...@@ -94,11 +94,11 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal
void saveBom(CharacteristicValue characteristicValue); void saveBom(CharacteristicValue characteristicValue);
CharacteristicValue findByCharacteristicValueName(String characteristicValueName,String superBomCode); CharacteristicValue findByCharacteristicValueName(String characteristicName,String characteristicValueName,String superBomCode);
String getName(Object v); String getName(Object v);
String getVNameByCode(String characteristicValueCode); String getVNameByCode(String characteristicValueCode,String characteristicCode);
CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName); CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName);
......
...@@ -12,4 +12,6 @@ public interface SuperTableInfoItemMapper extends IBaseMapper<SuperTableItemInfo ...@@ -12,4 +12,6 @@ public interface SuperTableInfoItemMapper extends IBaseMapper<SuperTableItemInfo
void saveBom(SuperTableItemInfo item); void saveBom(SuperTableItemInfo item);
SuperTableItemInfo getOne(SuperTableItemInfo item); SuperTableItemInfo getOne(SuperTableItemInfo item);
void deleteItemBom(String tableNumber,String superBomCode);
} }
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserInfoMapper extends IBaseMapper<UserInfo> {
UserInfo getUser(UserInfo userinfo);
}
...@@ -46,7 +46,7 @@ public class CtoBomRequestParamDto extends BasePageDto implements Serializable{ ...@@ -46,7 +46,7 @@ public class CtoBomRequestParamDto extends BasePageDto implements Serializable{
@ApiModelProperty(name = "description",value = "描述",dataType ="String") @ApiModelProperty(name = "description",value = "描述",dataType ="String")
private String description; private String description;
@ApiModelProperty(name = "modelStatus",value = "状态",dataType ="String") @ApiModelProperty(name = "modelStatus",value = "状态",dataType ="String")
private Integer modelStatus; private String modelStatus;
@ApiModelProperty(name = "type",value = "类型",dataType ="String") @ApiModelProperty(name = "type",value = "类型",dataType ="String")
private String type; private String type;
@ApiModelProperty(name = "productClassCode",value = "产品组",dataType ="String") @ApiModelProperty(name = "productClassCode",value = "产品组",dataType ="String")
......
package cn.com.uitech.authorization.pojo.entity;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.Accessors;
import javax.persistence.Column;
import javax.persistence.Table;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
@Table(name = "user_info")
@Builder
@ApiModel("user_info")
public class UserInfo {
@Column(name = "user_code")
private String userCode;
@Column(name = "pass_word")
private String password;
@Column(name = "user_name")
private String userName;
}
...@@ -21,13 +21,13 @@ public interface IntegrateService { ...@@ -21,13 +21,13 @@ public interface IntegrateService {
Characteristic findByCharacteristicName(String characteristicName,String superBomCode); Characteristic findByCharacteristicName(String characteristicName,String superBomCode);
CharacteristicValue findByCharacteristicValueName(String characteristicValueName,String superBomCode); CharacteristicValue findByCharacteristicValueName(String characteristicName,String characteristicValueName,String superBomCode);
String getName(Object v); String getName(Object v);
String getNameByCode(String characteristicCode,Integer isShow); String getNameByCode(String characteristicCode,Integer isShow);
String getVNameByCode(String characteristicValueCode); String getVNameByCode(String characteristicValueCode,String characteristicCode);
Object getSuperBomInfoByConfigId(Map<String, Object> map); Object getSuperBomInfoByConfigId(Map<String, Object> map);
...@@ -46,4 +46,6 @@ public interface IntegrateService { ...@@ -46,4 +46,6 @@ public interface IntegrateService {
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo); PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
Object querySkuOne(String configId); Object querySkuOne(String configId);
Object getToken(UserInfo userinfo);
} }
...@@ -13,6 +13,7 @@ import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto; ...@@ -13,6 +13,7 @@ import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto; import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto;
import cn.com.uitech.authorization.pojo.dto.ConsultationConfigurationAndPriceDto; import cn.com.uitech.authorization.pojo.dto.ConsultationConfigurationAndPriceDto;
import cn.com.uitech.authorization.pojo.entity.CharacteristicValue; import cn.com.uitech.authorization.pojo.entity.CharacteristicValue;
import cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.pojo.entity.OdRelation; import cn.com.uitech.authorization.pojo.entity.OdRelation;
import cn.com.uitech.authorization.service.CharacteristicValueService; import cn.com.uitech.authorization.service.CharacteristicValueService;
import cn.com.uitech.authorization.service.CtoBomService; import cn.com.uitech.authorization.service.CtoBomService;
...@@ -152,7 +153,8 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -152,7 +153,8 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
*/ */
@Override @Override
public Integer editCharacteristicValue(CharacteristicValue dto) { public Integer editCharacteristicValue(CharacteristicValue dto) {
GetSKUByH3CConfigInfo getSKUByH3CConfigInfo = new GetSKUByH3CConfigInfo();
//getSKUByH3CConfigInfo.setH3CPNList()
return characteristicValueMapper.editCharacteristicValue(dto); return characteristicValueMapper.editCharacteristicValue(dto);
} }
......
...@@ -8,6 +8,8 @@ import cn.com.uitech.authorization.pojo.entity.*; ...@@ -8,6 +8,8 @@ import cn.com.uitech.authorization.pojo.entity.*;
import cn.com.uitech.authorization.service.IntegrateService; import cn.com.uitech.authorization.service.IntegrateService;
import cn.com.uitech.authorization.service.SecurityService; import cn.com.uitech.authorization.service.SecurityService;
import cn.com.uitech.authorization.utils.ApiResult; import cn.com.uitech.authorization.utils.ApiResult;
import cn.com.uitech.authorization.utils.MD5Util;
import cn.com.uitech.authorization.utils.RedisHelper;
import cn.com.uitech.authorization.utils.Sequence; import cn.com.uitech.authorization.utils.Sequence;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -29,6 +31,7 @@ import org.springframework.util.ObjectUtils; ...@@ -29,6 +31,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.*; import java.util.*;
...@@ -50,6 +53,10 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -50,6 +53,10 @@ public class IntegrateServiceImpl implements IntegrateService {
@Autowired @Autowired
private SuperBomSkuInfoMapper superBomSkuInfoMapper; private SuperBomSkuInfoMapper superBomSkuInfoMapper;
@Autowired @Autowired
private UserInfoMapper userInfoMapper;
@Resource
private RedisHelper redisHelper;
@Autowired
private Sequence sequence; private Sequence sequence;
@Value("${plm.url}") @Value("${plm.url}")
private String plmUrl; private String plmUrl;
...@@ -67,6 +74,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -67,6 +74,7 @@ public class IntegrateServiceImpl implements IntegrateService {
//TYPE=SuperPart数据插入到SuperBOMInfo //TYPE=SuperPart数据插入到SuperBOMInfo
try { try {
if (!CollectionUtils.isEmpty(saveSuperBomInputDtos)) { if (!CollectionUtils.isEmpty(saveSuperBomInputDtos)) {
int flag = 0;
for (SaveSuperBomInputDto saveSuperBomInputDto : saveSuperBomInputDtos) { for (SaveSuperBomInputDto saveSuperBomInputDto : saveSuperBomInputDtos) {
if (saveSuperBomInputDto.getType().equals("SuperPart")) { if (saveSuperBomInputDto.getType().equals("SuperPart")) {
ConfigurableBom configurableBom = new ConfigurableBom(); ConfigurableBom configurableBom = new ConfigurableBom();
...@@ -78,6 +86,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -78,6 +86,8 @@ public class IntegrateServiceImpl implements IntegrateService {
configurableBom.setProductClassName(saveSuperBomInputDto.getClassification()); configurableBom.setProductClassName(saveSuperBomInputDto.getClassification());
configurableBom.setUnisSalesName(saveSuperBomInputDto.getScuxItemName()); configurableBom.setUnisSalesName(saveSuperBomInputDto.getScuxItemName());
configurableBom.setBrand(saveSuperBomInputDto.getBrand()); configurableBom.setBrand(saveSuperBomInputDto.getBrand());
configurableBom.setRevision(saveSuperBomInputDto.getRevision());
configurableBom.setType(saveSuperBomInputDto.getType());
ConfigurableBom getOne = ctoBomMapper.getCtoBomsByCode(configurableBom.getSuperBomCode(), configurableBom.getProductClassName()); ConfigurableBom getOne = ctoBomMapper.getCtoBomsByCode(configurableBom.getSuperBomCode(), configurableBom.getProductClassName());
if (!ObjectUtils.isEmpty(getOne)) { if (!ObjectUtils.isEmpty(getOne)) {
BeanUtils.copyProperties(configurableBom, getOne); BeanUtils.copyProperties(configurableBom, getOne);
...@@ -86,6 +96,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -86,6 +96,7 @@ public class IntegrateServiceImpl implements IntegrateService {
log.setUpdateTime(new Timestamp(System.currentTimeMillis())); log.setUpdateTime(new Timestamp(System.currentTimeMillis()));
ctoBomMapper.saveLog(log); ctoBomMapper.saveLog(log);
ctoBomMapper.updateCtoBom(getOne); ctoBomMapper.updateCtoBom(getOne);
flag++;
} else { } else {
configurableBom.setIsState(0); configurableBom.setIsState(0);
ConfigurableBomLog log = new ConfigurableBomLog(); ConfigurableBomLog log = new ConfigurableBomLog();
...@@ -93,12 +104,17 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -93,12 +104,17 @@ public class IntegrateServiceImpl implements IntegrateService {
log.setInsertTime(new Timestamp(System.currentTimeMillis())); log.setInsertTime(new Timestamp(System.currentTimeMillis()));
ctoBomMapper.saveLog(log); ctoBomMapper.saveLog(log);
ctoBomMapper.saveConfigurableBom(configurableBom); ctoBomMapper.saveConfigurableBom(configurableBom);
flag++;
} }
result.setCode(ApiResult.SUCCESS.getCode());
result.setMsg(ApiResult.SUCCESS.getMsg()); } else {
result.setCode(ApiResult.API_REQ_DATA_IS_FAIL.getCode());
result.setMsg("请检查数据格式");
return result;
} }
} }
result.setCode(ApiResult.SUCCESS.getCode());
result.setMsg("数据集成完成,成功条数:" + flag);
} else { } else {
result.setCode(ApiResult.API_REQ_DATA_IS_FAIL.getCode()); result.setCode(ApiResult.API_REQ_DATA_IS_FAIL.getCode());
result.setMsg(ApiResult.API_REQ_DATA_IS_FAIL.getMsg()); result.setMsg(ApiResult.API_REQ_DATA_IS_FAIL.getMsg());
...@@ -121,7 +137,9 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -121,7 +137,9 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristic.setCharacteristicCode(saveSuperCharacterInputDto.getOptionNumber()); characteristic.setCharacteristicCode(saveSuperCharacterInputDto.getOptionNumber());
characteristic.setCharacteristicName(saveSuperCharacterInputDto.getOptionName()); characteristic.setCharacteristicName(saveSuperCharacterInputDto.getOptionName());
characteristic.setSuperBomCode(saveSuperCharacterInputDto.getSuperNumber()); characteristic.setSuperBomCode(saveSuperCharacterInputDto.getSuperNumber());
characteristic.setIsShow(0); characteristic.setUnisSalesCName(saveSuperCharacterInputDto.getOptionName());
characteristic.setIsShow(1);
characteristic.setIsHidden(0);
characteristic.setCharacteristicType("否"); characteristic.setCharacteristicType("否");
Characteristic getOne = characteristicMapper.selectByCode(characteristic); Characteristic getOne = characteristicMapper.selectByCode(characteristic);
if (!ObjectUtils.isEmpty(getOne)) { if (!ObjectUtils.isEmpty(getOne)) {
...@@ -132,7 +150,6 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -132,7 +150,6 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristicMapper.saveLog(log); characteristicMapper.saveLog(log);
characteristicMapper.updateBom(getOne); characteristicMapper.updateBom(getOne);
} else { } else {
characteristic.setIsHidden(0);
CharacteristicLog log = new CharacteristicLog(); CharacteristicLog log = new CharacteristicLog();
BeanUtils.copyProperties(characteristic, log); BeanUtils.copyProperties(characteristic, log);
log.setInsertTime(new Timestamp(System.currentTimeMillis())); log.setInsertTime(new Timestamp(System.currentTimeMillis()));
...@@ -152,6 +169,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -152,6 +169,7 @@ public class IntegrateServiceImpl implements IntegrateService {
GetProductOutDto result = new GetProductOutDto(); GetProductOutDto result = new GetProductOutDto();
try { try {
if (!CollectionUtils.isEmpty(saveSuperCharacterValueInputDtos)) { if (!CollectionUtils.isEmpty(saveSuperCharacterValueInputDtos)) {
int flag = 0;
for (SaveSuperCharacterValueInputDto saveSuperCharacterValueInputDto : saveSuperCharacterValueInputDtos) { for (SaveSuperCharacterValueInputDto saveSuperCharacterValueInputDto : saveSuperCharacterValueInputDtos) {
CharacteristicValue characteristicValue = new CharacteristicValue(); CharacteristicValue characteristicValue = new CharacteristicValue();
characteristicValue.setCharacteristicValueCode(saveSuperCharacterValueInputDto.getChoiceNumber()); characteristicValue.setCharacteristicValueCode(saveSuperCharacterValueInputDto.getChoiceNumber());
...@@ -166,27 +184,37 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -166,27 +184,37 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristicValue.setZphName(saveSuperCharacterValueInputDto.getZphName()); characteristicValue.setZphName(saveSuperCharacterValueInputDto.getZphName());
characteristicValue.setH3cDeliverCode(saveSuperCharacterValueInputDto.getH3cDeliverCode()); characteristicValue.setH3cDeliverCode(saveSuperCharacterValueInputDto.getH3cDeliverCode());
characteristicValue.setUnisSalesVName(saveSuperCharacterValueInputDto.getChoiceName()); characteristicValue.setUnisSalesVName(saveSuperCharacterValueInputDto.getChoiceName());
characteristicValue.setUnisSalesCName(saveSuperCharacterValueInputDto.getOptionNumber()); characteristicValue.setCharacteristicCode(saveSuperCharacterValueInputDto.getOptionNumber());
CharacteristicValue getOne = characteristicValueMapper.selectByCode(characteristicValue); CharacteristicValue getOne = characteristicValueMapper.selectByCode(characteristicValue);
if (!ObjectUtils.isEmpty(getOne)) { if (!ObjectUtils.isEmpty(getOne)) {
characteristicValue.setIsBase(0);
characteristicValue.setIsShow(1);
characteristicValue.setIsState(0);
BeanUtils.copyProperties(characteristicValue, getOne); BeanUtils.copyProperties(characteristicValue, getOne);
CharacteristicValueLog log = new CharacteristicValueLog(); CharacteristicValueLog log = new CharacteristicValueLog();
BeanUtils.copyProperties(getOne, log); BeanUtils.copyProperties(getOne, log);
log.setUpdateTime(new Timestamp(System.currentTimeMillis())); log.setUpdateTime(new Timestamp(System.currentTimeMillis()));
characteristicValueMapper.saveLog(log); characteristicValueMapper.saveLog(log);
characteristicValueMapper.updateBom(getOne); characteristicValueMapper.updateBom(getOne);
flag++;
} else { } else {
characteristicValue.setIsBase(0);
characteristicValue.setIsShow(1);
characteristicValue.setIsState(0); characteristicValue.setIsState(0);
CharacteristicValueLog log = new CharacteristicValueLog(); CharacteristicValueLog log = new CharacteristicValueLog();
BeanUtils.copyProperties(characteristicValue, log); BeanUtils.copyProperties(characteristicValue, log);
log.setInsertTime(new Timestamp(System.currentTimeMillis())); log.setInsertTime(new Timestamp(System.currentTimeMillis()));
characteristicValueMapper.saveLog(log); characteristicValueMapper.saveLog(log);
characteristicValueMapper.saveBom(characteristicValue); characteristicValueMapper.saveBom(characteristicValue);
flag++;
} }
} }
result.setMsg("table数据集成成功,成功条数:" + flag);
result.setCode(ApiResult.SUCCESS.getCode());
return result;
} }
} catch (Exception e) { } catch (Exception e) {
new BusinessException(ApiResult.INTERNAL_SERVER_ERROR.getMsg()); return result.setMsg(e.getMessage());
} }
return result; return result;
} }
...@@ -195,11 +223,11 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -195,11 +223,11 @@ public class IntegrateServiceImpl implements IntegrateService {
public GetProductOutDto SetSuperTableInfo(List<SaveTableInputDto> saveTableInputDtos) { public GetProductOutDto SetSuperTableInfo(List<SaveTableInputDto> saveTableInputDtos) {
GetProductOutDto result = new GetProductOutDto(); GetProductOutDto result = new GetProductOutDto();
try { try {
for (SaveTableInputDto saveTableInputDto : saveTableInputDtos) { if (!ObjectUtils.isEmpty(saveTableInputDtos)) {
if (!ObjectUtils.isEmpty(saveTableInputDtos)) { int flag = 0;
for (SaveTableInputDto saveTableInputDto : saveTableInputDtos) {
List<String> superBomCodeList = saveTableInputDto.getSuperBomCode(); List<String> superBomCodeList = saveTableInputDto.getSuperBomCode();
for (String superBomCode : superBomCodeList) { for (String superBomCode : superBomCodeList) {
SuperTableInfo superTableInfo = new SuperTableInfo(); SuperTableInfo superTableInfo = new SuperTableInfo();
superTableInfo.setId(sequence.nextId()); superTableInfo.setId(sequence.nextId());
superTableInfo.setSuperBomCode(superBomCode); superTableInfo.setSuperBomCode(superBomCode);
...@@ -217,6 +245,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -217,6 +245,7 @@ public class IntegrateServiceImpl implements IntegrateService {
superTableInfoMapper.saveBom(getOne); superTableInfoMapper.saveBom(getOne);
if (!CollectionUtils.isEmpty(saveTableInputDto.getTableLists())) { if (!CollectionUtils.isEmpty(saveTableInputDto.getTableLists())) {
List<SaveTableInputDto.SuperTableItemDto> tableLists = saveTableInputDto.getTableLists(); List<SaveTableInputDto.SuperTableItemDto> tableLists = saveTableInputDto.getTableLists();
superTableInfoItemMapper.deleteItemBom(saveTableInputDto.getTableNumber(), superBomCode);
for (SaveTableInputDto.SuperTableItemDto tableItem : tableLists) { for (SaveTableInputDto.SuperTableItemDto tableItem : tableLists) {
SuperTableItemInfo item = new SuperTableItemInfo(); SuperTableItemInfo item = new SuperTableItemInfo();
item.setId(sequence.nextId()); item.setId(sequence.nextId());
...@@ -232,28 +261,55 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -232,28 +261,55 @@ public class IntegrateServiceImpl implements IntegrateService {
superTableInfoItemMapper.saveLog(itemLog); superTableInfoItemMapper.saveLog(itemLog);
superTableInfoItemMapper.saveBom(item); superTableInfoItemMapper.saveBom(item);
} }
} else {
result.setMsg("请检查数据格式是否正确");
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return result;
} }
result.setMsg(ApiResult.SUCCESS.getMsg()); flag++;
result.setCode(ApiResult.SUCCESS.getCode());
} else { } else {
SuperTableInfoLog log = new SuperTableInfoLog(); SuperTableInfoLog log = new SuperTableInfoLog();
BeanUtils.copyProperties(superTableInfo, log); BeanUtils.copyProperties(superTableInfo, log);
log.setCreateTime(new Timestamp(System.currentTimeMillis())); log.setCreateTime(new Timestamp(System.currentTimeMillis()));
log.setCreateBy(SecurityService.getPrincipal().getCode()); log.setCreateBy(SecurityService.getPrincipal().getCode());
superTableInfoMapper.saveLog(log); superTableInfoMapper.saveLog(log);
superTableInfoMapper.deleteBom(getOne);
superTableInfoMapper.saveBom(superTableInfo); superTableInfoMapper.saveBom(superTableInfo);
result.setMsg(ApiResult.SUCCESS.getMsg()); if (!CollectionUtils.isEmpty(saveTableInputDto.getTableLists())) {
result.setCode(ApiResult.SUCCESS.getCode()); List<SaveTableInputDto.SuperTableItemDto> tableLists = saveTableInputDto.getTableLists();
superTableInfoItemMapper.deleteItemBom(saveTableInputDto.getTableNumber(), superBomCode);
for (SaveTableInputDto.SuperTableItemDto tableItem : tableLists) {
SuperTableItemInfo item = new SuperTableItemInfo();
item.setId(sequence.nextId());
item.setGroupNumber(tableItem.getLineCode());
item.setSuperBomCode(superBomCode);
item.setTableNumber(saveTableInputDto.getTableNumber());
item.setCharacteristicCode(tableItem.getCharacteristicCode());
item.setCharacteristicValueCode(tableItem.getCharacteristicValueCode());
item.setCreateBy(SecurityService.getPrincipal().getCode());
item.setCreateTime(new Timestamp(System.currentTimeMillis()));
SuperTableItemInfoLog itemLog = new SuperTableItemInfoLog();
BeanUtils.copyProperties(item, itemLog);
superTableInfoItemMapper.saveLog(itemLog);
superTableInfoItemMapper.saveBom(item);
}
} else {
result.setMsg("请检查数据格式是否正确");
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return result;
}
flag++;
} }
} }
} }
result.setMsg("table数据集成成功,成功条数:" + flag);
result.setCode(ApiResult.SUCCESS.getCode());
return result;
} }
} catch (Exception e) { } catch (Exception e) {
result.setMsg(ApiResult.INTERNAL_SERVER_ERROR.getMsg());
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
result.setData(new BusinessException());
return result; return result;
} }
return result; return result;
...@@ -271,8 +327,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -271,8 +327,8 @@ public class IntegrateServiceImpl implements IntegrateService {
} }
@Override @Override
public CharacteristicValue findByCharacteristicValueName(String characteristicValueName, String superBomCode) { public CharacteristicValue findByCharacteristicValueName(String characteristicName, String characteristicValueName, String superBomCode) {
return characteristicValueMapper.findByCharacteristicValueName(characteristicValueName, superBomCode); return characteristicValueMapper.findByCharacteristicValueName(characteristicName, characteristicValueName, superBomCode);
} }
@Override @Override
...@@ -320,12 +376,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -320,12 +376,8 @@ public class IntegrateServiceImpl implements IntegrateService {
superBomSkuInfo.setSkuCode(data.getSkuCode()); superBomSkuInfo.setSkuCode(data.getSkuCode());
superBomSkuInfo.setSkuName(data.getSkuName()); superBomSkuInfo.setSkuName(data.getSkuName());
} else { } else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData(); superBomSkuInfo.setDescription("调用PLM申请回号失败");
data.setConfigId(superBomSkuInfo.getConfigId()); characteristicMapper.updateSuperBomSku(superBomSkuInfo);
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
superBomSkuInfo.setSkuCode(data.getSkuCode());
superBomSkuInfo.setSkuName(data.getSkuName());
} }
} else { } else {
result.setMsg(applySkuCodeResultDto.getMsg()); result.setMsg(applySkuCodeResultDto.getMsg());
...@@ -385,6 +437,22 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -385,6 +437,22 @@ public class IntegrateServiceImpl implements IntegrateService {
return superBomSkuInfoMapper.querySkuOne(configId); return superBomSkuInfoMapper.querySkuOne(configId);
} }
@Override
public Object getToken(UserInfo userinfo) {
GetProductOutDto result = new GetProductOutDto();
UserInfo getOne = userInfoMapper.getUser(userinfo);
if (!ObjectUtils.isEmpty(getOne)) {
String md5Str = MD5Util.getMD5Str(getOne.getPassword()+"_unis_cpq_"+getOne.getUserCode());
String doubleMd5 = MD5Util.getMD5Str(md5Str);
result.setData(doubleMd5);
redisHelper.set("unis_cpq:"+getOne.getUserCode()+"_"+getOne.getPassword(),doubleMd5,86400);
} else {
result.setMsg("用户不存在/密码错误");
result.setCode(500);
}
return result;
}
/** /**
* @return Configid, SKUCode,SKUCode,产品型号,产品小型好,69码 * @return Configid, SKUCode,SKUCode,产品型号,产品小型好,69码
...@@ -396,12 +464,9 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -396,12 +464,9 @@ public class IntegrateServiceImpl implements IntegrateService {
public ApplySkuCodeResultDto applySkuCode(SuperBomSkuInfo superBomSkuInfo) { public ApplySkuCodeResultDto applySkuCode(SuperBomSkuInfo superBomSkuInfo) {
ApplySkuCodeResultDto dto = new ApplySkuCodeResultDto(); ApplySkuCodeResultDto dto = new ApplySkuCodeResultDto();
Map<String, Object> map = null;
try { try {
//调用PLM 申请skuCode //调用PLM 申请skuCode
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
HttpHeaders tokenHeader = getHttpHeaderPlmToken(); HttpHeaders tokenHeader = getHttpHeaderPlmToken();
HttpEntity<String> tokenRequestEntity = new HttpEntity<>(null, tokenHeader); HttpEntity<String> tokenRequestEntity = new HttpEntity<>(null, tokenHeader);
...@@ -425,18 +490,18 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -425,18 +490,18 @@ public class IntegrateServiceImpl implements IntegrateService {
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList(); List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
if (!CollectionUtils.isEmpty(characteristicList)) { if (!CollectionUtils.isEmpty(characteristicList)) {
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) { for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
ToPLMDto.OptionChoiceMap map = new ToPLMDto.OptionChoiceMap(); ToPLMDto.OptionChoiceMap map1 = new ToPLMDto.OptionChoiceMap();
map.setSpecial(false); map1.setSpecial(false);
map.setOption(superBomSkuConfigInfo.getCharacteristicName()); map1.setOption(superBomSkuConfigInfo.getCharacteristicName());
map.setChoice(superBomSkuConfigInfo.getCharacteristicValueName()); map1.setChoice(superBomSkuConfigInfo.getCharacteristicValueName());
map.setSpecialDescription(superBomSkuInfo.getDescription()); map1.setSpecialDescription(superBomSkuInfo.getDescription());
maps.add(map); maps.add(map1);
} }
} }
toPLMDto.setOptionChoiceMaps(maps); toPLMDto.setOptionChoiceMaps(maps);
HttpHeaders headers = getHttpHeaderPlm(nonce); HttpHeaders headers = getHttpHeaderPlm(nonce);
HttpEntity httpEntity = new HttpEntity<>(JSONObject.toJSON(toPLMDto), headers); HttpEntity httpEntity = new HttpEntity<>(JSONObject.toJSON(toPLMDto), headers);
Map<String, Object> map = (Map<String, Object>) restTemplate.exchange(plmUrl, HttpMethod.POST, httpEntity, Object.class).getBody(); map = (Map<String, Object>) restTemplate.exchange(plmUrl, HttpMethod.POST, httpEntity, Object.class).getBody();
Integer code = (Integer) map.get("code"); Integer code = (Integer) map.get("code");
if (!ObjectUtils.isEmpty(code)) { if (!ObjectUtils.isEmpty(code)) {
if (code.equals(200)) { if (code.equals(200)) {
...@@ -459,7 +524,7 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -459,7 +524,7 @@ public class IntegrateServiceImpl implements IntegrateService {
} }
} }
} catch (Exception e) { } catch (Exception e) {
dto.setMsg("该配置在CPQ不存在,调用PLM申请回号失败!"); dto.setMsg(e.getMessage());
dto.setCode(500); dto.setCode(500);
return dto; return dto;
} }
...@@ -467,8 +532,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -467,8 +532,8 @@ public class IntegrateServiceImpl implements IntegrateService {
} }
@Override @Override
public String getVNameByCode(String characteristicValueCode) { public String getVNameByCode(String characteristicValueCode, String characteristicCode) {
return characteristicValueMapper.getVNameByCode(characteristicValueCode); return characteristicValueMapper.getVNameByCode(characteristicValueCode, characteristicCode);
} }
@Override @Override
...@@ -620,12 +685,8 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -620,12 +685,8 @@ public class IntegrateServiceImpl implements IntegrateService {
cpnList.setSkuName(data.getSkuName()); cpnList.setSkuName(data.getSkuName());
characteristicMapper.updateSuperBomSkuInfo(data); characteristicMapper.updateSuperBomSkuInfo(data);
} else { } else {
ApplySkuCodeResultDto.data data = skuInfo.getData(); superBomSkuInfo.setDescription("调用PLM申请回号失败");
data.setConfigId(superBomSkuInfo.getConfigId()); characteristicMapper.updateSuperBomSku(superBomSkuInfo);
data.setMsg("未回号");
cpnList.setCode(skuInfo.getCode());
cpnList.setMsg(skuInfo.getMsg());
characteristicMapper.updateSuperBomSkuStatus(data);
} }
} else { } else {
result.setMsg(skuInfo.getMsg()); result.setMsg(skuInfo.getMsg());
...@@ -672,14 +733,20 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -672,14 +733,20 @@ public class IntegrateServiceImpl implements IntegrateService {
public Object saveSukInfo(SuperBomSkuInfo superBomSkuInfo) { public Object saveSukInfo(SuperBomSkuInfo superBomSkuInfo) {
GetProductOutDto result = new GetProductOutDto(); GetProductOutDto result = new GetProductOutDto();
try { try {
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
SuperBomSkuConfigInfo skuConfigInfo = characteristicMapper.checkConfig(superBomSkuConfigInfo.getCharacteristicCode(), superBomSkuConfigInfo.getCharacteristicValueName(), superBomSkuInfo.getSuperBomCode(), superBomSkuInfo.getPatern(), superBomSkuInfo.getPoliticalMiningId(), superBomSkuInfo.getConfigId(), superBomSkuConfigInfo.getCharacteristicValueCode());
if (ObjectUtils.isEmpty(skuConfigInfo)) {
//撞配不通过 保存SKU信息 调用申请SKU接口 applySkuCode
SuperBomSkuConfigInfo config = new SuperBomSkuConfigInfo();
BeanUtils.copyProperties(superBomSkuConfigInfo, config);
config.setId(sequence.nextId());
config.setConfigId(superBomSkuInfo.getConfigId());
superBomSkuInfoMapper.saveSkuConfig(config);
}
}
superBomSkuInfo.setId(sequence.nextId()); superBomSkuInfo.setId(sequence.nextId());
superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo); superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo);
List<SuperBomSkuConfigInfo> superBomSkuConfigInfos = superBomSkuInfo.getCharacteristicList();
superBomSkuConfigInfos.forEach(item -> {
item.setId(sequence.nextId());
item.setConfigId(superBomSkuInfo.getConfigId());
superBomSkuInfoMapper.saveSkuConfig(item);
});
//保存完成后申请SKU 调用PLM申请SKU编号 //保存完成后申请SKU 调用PLM申请SKU编号
ApplySkuCodeResultDto applySkuCodeResultDto = applySkuCode(superBomSkuInfo); ApplySkuCodeResultDto applySkuCodeResultDto = applySkuCode(superBomSkuInfo);
//根据 ConfigId 修改 产品小型号 产品型号 SkuCode 69码 //根据 ConfigId 修改 产品小型号 产品型号 SkuCode 69码
...@@ -691,18 +758,17 @@ public class IntegrateServiceImpl implements IntegrateService { ...@@ -691,18 +758,17 @@ public class IntegrateServiceImpl implements IntegrateService {
result.setCode(applySkuCodeResultDto.getCode()); result.setCode(applySkuCodeResultDto.getCode());
result.setMsg(applySkuCodeResultDto.getMsg()); result.setMsg(applySkuCodeResultDto.getMsg());
} else { } else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
result.setCode(applySkuCodeResultDto.getCode()); result.setCode(applySkuCodeResultDto.getCode());
result.setMsg(applySkuCodeResultDto.getMsg()); result.setMsg("调用PLM申请回号失败");
result.setData(applySkuCodeResultDto); result.setData(applySkuCodeResultDto);
return result; return result;
} }
} catch (Exception e) { } catch (Exception e) {
new BusinessException(ApiResult.INTERNAL_SERVER_ERROR.getMsg()); result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
result.setMsg(ApiResult.INTERNAL_SERVER_ERROR.getMsg());
result.setData(e.getMessage());
return result;
} }
return result; return result;
} }
......
package cn.com.uitech.authorization.utils;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5Util {
public static String getMD5Str(String str) {
byte[] digest = null;
try {
MessageDigest md5 = MessageDigest.getInstance("md5");
digest = md5.digest(str.getBytes("utf-8"));
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//16是表示转换为16进制数
String md5Str = new BigInteger(1, digest).toString(16);
return md5Str;
}
}
\ No newline at end of file
...@@ -24,28 +24,14 @@ ...@@ -24,28 +24,14 @@
<update id="updateCharacteristic" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto" > <update id="updateCharacteristic" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto" >
update super_characteristic_info update super_characteristic_info
<set> set
<if test="characteristicName!=null and characteristicName!=''">
characteristic_name =#{characteristicName}, characteristic_name =#{characteristicName},
</if>
<if test="unisSalesCName!=null and unisSalesCName!=''">
unis_Sales_C_Name =#{unisSalesCName}, unis_Sales_C_Name =#{unisSalesCName},
</if>
<if test="characteristicType!=null and characteristicType!=''">
characteristic_type =#{characteristicType}, characteristic_type =#{characteristicType},
</if>
<if test="H3CCCode!=null and H3CCCode!=''">
h3c_c_code =#{H3CCCode}, h3c_c_code =#{H3CCCode},
</if>
<if test="isHidden!=null ">
is_hidden =#{isHidden} is_hidden =#{isHidden}
</if> where
</set>
<where>
<if test="characteristicCode!=null and characteristicCode!=''">
Characteristic_Code=#{characteristicCode} Characteristic_Code=#{characteristicCode}
</if>
</where>
</update> </update>
<update id="updateVisibleType" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto"> <update id="updateVisibleType" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto">
...@@ -194,7 +180,7 @@ ...@@ -194,7 +180,7 @@
sku_code = #{skuCode}, sku_code = #{skuCode},
sku_name = #{skuName}, sku_name = #{skuName},
apply_status = #{msg}, apply_status = #{msg},
sn_code = #{snCode}, sncode = #{snCode},
description = #{description}, description = #{description},
product_type =#{productType}, product_type =#{productType},
product_small_type =#{productSmallType} product_small_type =#{productSmallType}
...@@ -204,4 +190,8 @@ ...@@ -204,4 +190,8 @@
<update id="updateSuperBomSkuStatus"> <update id="updateSuperBomSkuStatus">
update super_bom_sku_info set msg = #{msg} where config_id = #{configId} update super_bom_sku_info set msg = #{msg} where config_id = #{configId}
</update> </update>
<update id="updateSuperBomSku">
update super_bom_sku_info set apply_status = #{description} where config_id = #{configId}
</update>
</mapper> </mapper>
...@@ -65,32 +65,15 @@ ...@@ -65,32 +65,15 @@
<update id="editCharacteristicValue" parameterType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <update id="editCharacteristicValue" parameterType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
UPDATE super_characteristic_value_info UPDATE super_characteristic_value_info
<set> set
<if test="characteristicValueName!=null and characteristicValueName!=''">
characteristic_Value_name=#{characteristicValueName}, characteristic_Value_name=#{characteristicValueName},
</if>
<if test="isState!=null">
is_state=#{isState}, is_state=#{isState},
</if>
<if test="isShow!=null">
is_Show=#{isShow}, is_Show=#{isShow},
</if>
<if test="zphCode!=null and zphCode!=''">
zph_code=#{zphCode}, zph_code=#{zphCode},
</if>
<if test="zphName!=null and zphName!=''">
zph_name=#{zphName}, zph_name=#{zphName},
</if>
<if test="qualifyDate!=null">
qualify_date=#{qualifyDate}, qualify_date=#{qualifyDate},
</if>
<if test="unisSalesVName!=null and unisSalesVName!=''">
unis_sales_v_name=#{unisSalesVName}, unis_sales_v_name=#{unisSalesVName},
</if> h3c_c_value=#{h3cCValue}
<if test="h3cCValue!=null and h3cCValue!=''">
h3c_c_value=#{h3cCValue},
</if>
</set>
<where> <where>
<if test="characteristicValueCode!=null and characteristicValueCode.length>0"> <if test="characteristicValueCode!=null and characteristicValueCode.length>0">
Characteristic_Value_Code=#{characteristicValueCode} Characteristic_Value_Code=#{characteristicValueCode}
...@@ -232,7 +215,7 @@ ...@@ -232,7 +215,7 @@
</select> </select>
<select id="selectByCode" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <select id="selectByCode" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info where Characteristic_Value_Code=#{characteristicValueCode} select * from super_characteristic_value_info where Characteristic_Value_Code=#{characteristicValueCode} and Characteristic_Code = #{characteristicCode}
</select> </select>
<insert id="saveLog"> <insert id="saveLog">
...@@ -246,7 +229,10 @@ ...@@ -246,7 +229,10 @@
unis_sales_v_name, unis_sales_v_name,
h3c_c_value, h3c_c_value,
is_base, is_base,
is_show,update_time,insert_time,h3c_deliver_code ) is_show,
update_time,
insert_time,
h3c_deliver_code )
VALUES VALUES
( (
#{characteristicValueCode},#{characteristicCode},#{characteristicValueName}, #{characteristicValueCode},#{characteristicCode},#{characteristicValueName},
...@@ -296,7 +282,7 @@ ...@@ -296,7 +282,7 @@
</insert> </insert>
<select id="findByCharacteristicValueName" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <select id="findByCharacteristicValueName" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info where characteristic_value_name = #{characteristicValueName} and super_bom_code = #{superBomCode} select * from super_characteristic_value_info where characteristic_code = #{characteristicName} and characteristic_value_name = #{characteristicValueName} and super_bom_code = #{superBomCode}
</select> </select>
<select id="getName" resultType="java.lang.String"> <select id="getName" resultType="java.lang.String">
...@@ -309,7 +295,7 @@ ...@@ -309,7 +295,7 @@
</select> </select>
<select id="getVNameByCode" resultType="java.lang.String"> <select id="getVNameByCode" resultType="java.lang.String">
select characteristic_value_name from super_characteristic_value_info where characteristic_value_code = #{characteristicValueCode} select characteristic_value_name from super_characteristic_value_info where characteristic_value_code = #{characteristicValueCode} and characteristic_code = #{characteristicCode}
</select> </select>
<select id="getCharacteristicValueInfoByName" <select id="getCharacteristicValueInfoByName"
......
...@@ -29,39 +29,18 @@ ...@@ -29,39 +29,18 @@
</select> </select>
<update id="updateCtoBomByBomCode" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto"> <update id="updateCtoBomByBomCode" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto">
UPDATE super_bom_info UPDATE super_bom_info set
<set>
<if test="superBomName!=null and superBomName!=''">
super_bom_name=#{superBomName} , super_bom_name=#{superBomName} ,
</if>
<if test="type!=null and type!=''">
type=#{type} , type=#{type} ,
</if>
<if test="isState!=null">
is_state=#{isState} , is_state=#{isState} ,
</if>
<if test="modelStatus!=null">
model_status=#{modelStatus} , model_status=#{modelStatus} ,
</if>
<if test="h3cPn!=null and h3cPn!=''">
h3c_pn=#{h3cPn} , h3c_pn=#{h3cPn} ,
</if>
<if test="configId!=null and configId!=''">
config_id=#{configId} , config_id=#{configId} ,
</if>
<if test="productClassCode!=null and productClassCode!=''">
product_class_code=#{productClassCode}, product_class_code=#{productClassCode},
</if> unis_sales_name=#{unisSalesName}
<if test="unisSalesName!=null and unisSalesName!=''"> where
unis_sales_name=#{unisSalesName}, <if test="superBomCode!=null and superBomCode!=''">
</if> super_bom_code=#{superBomCode}
</set>
<where>
1=1
<if test="superBomCode!=null">
and super_bom_code=#{superBomCode}
</if> </if>
<if test="superBomCodes!=null and superBomCodes.length>0"> <if test="superBomCodes!=null and superBomCodes.length>0">
and super_bom_code in and super_bom_code in
...@@ -69,7 +48,6 @@ ...@@ -69,7 +48,6 @@
#{superBomCode} #{superBomCode}
</foreach> </foreach>
</if> </if>
</where>
</update> </update>
<select id="getCtoBomsByCode" parameterType="java.lang.String" <select id="getCtoBomsByCode" parameterType="java.lang.String"
...@@ -265,7 +243,9 @@ ...@@ -265,7 +243,9 @@
type = #{type}, type = #{type},
model_status = #{modelStatus}, model_status = #{modelStatus},
unis_sales_name = #{unisSalesName}, unis_sales_name = #{unisSalesName},
brand = #{brand} brand = #{brand},
revision = #{revision},
type = #{type}
where super_bom_code = #{superBomCode} where super_bom_code = #{superBomCode}
</update> </update>
......
...@@ -5,24 +5,28 @@ ...@@ -5,24 +5,28 @@
<insert id="saveLog"> <insert id="saveLog">
INSERT INTO super_table_item_info_log ( INSERT INTO super_table_item_info_log (
table_number,group_number,Characteristic_Code,Characteristic_value_Code, table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id ) create_time,create_by,id,super_bom_code )
VALUES VALUES
( (
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id} #{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
); );
</insert> </insert>
<insert id="saveBom"> <insert id="saveBom">
INSERT INTO super_table_item_info ( INSERT INTO super_table_item_info (
table_number,group_number,Characteristic_Code,Characteristic_value_Code, table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id ) create_time,create_by,id,super_bom_code )
VALUES VALUES
( (
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id} #{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
); );
</insert> </insert>
<select id="getOne" resultType="cn.com.uitech.authorization.pojo.entity.SuperTableItemInfo"> <select id="getOne" resultType="cn.com.uitech.authorization.pojo.entity.SuperTableItemInfo">
select * from super_table_item_info where super_bom_code = #{superBomCode} and Characteristic_value_Code = #{characteristicValueCode} select * from super_table_item_info where super_bom_code = #{superBomCode} and Characteristic_value_Code = #{characteristicValueCode}
</select> </select>
<delete id="deleteItemBom">
delete from super_table_item_info where table_number = #{tableNumber} and super_bom_code = #{superBomCode}
</delete>
</mapper> </mapper>
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
</insert> </insert>
<delete id="deleteBom"> <delete id="deleteBom">
delete from super_table_info where super_bom_code = #{superBomCode}; delete from super_table_info where super_bom_code = #{superBomCode} and table_number = #{tableNumber};
delete from super_table_item_info where super_bom_code = #{superBomCode};
</delete> </delete>
<resultMap id="baseResultMap" type="cn.com.uitech.authorization.pojo.dto.SuperTableInfoDto"> <resultMap id="baseResultMap" type="cn.com.uitech.authorization.pojo.dto.SuperTableInfoDto">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.uitech.authorization.mapper.UserInfoMapper">
<select id="getUser" resultType="cn.com.uitech.authorization.pojo.entity.UserInfo">
select * from user_info where user_code = #{userCode} and pass_word = #{password}
</select>
</mapper>
\ No newline at end of file
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