Commit 43598ab9 by zhaoxiaolei

updateLog

parent f753a40a
......@@ -337,10 +337,10 @@ public class IntegrateController {
}
@GetMapping("/querySkuOne/{configId}")
@GetMapping("/querySkuOne/{configId}/{id}")
@ApiOperation(value = "查询sku信息One", notes = "querySkuOne", httpMethod = "GET")
public CrmResponseEntity<?> querySkuOne(@PathVariable(value = "configId") String configId) {
return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId));
public CrmResponseEntity<?> querySkuOne(@PathVariable(value = "configId") String configId,@PathVariable(value = "id") String id) {
return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId,id));
}
@PostMapping("/getToken")
......
......@@ -98,5 +98,5 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
void saveLogOpera(CharacteristicLogOpera logOpera);
void saveAppluOpera(String httpEntity, String userCode, String plmUrl);
void saveApplyOpera(String httpEntity, String userCode, String plmUrl);
}
......@@ -57,4 +57,6 @@ public interface SuperBomPriceCalculateMapper {
Characteristics getPriceByCode(String superBomCode, String characteristicCode, String characteristicValueCode);
void saveLogOpera(CharacteristicsLogOpera logOpera);
String getSuperBomName(String superBomCode);
}
......@@ -22,7 +22,7 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
List<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
SuperBomSkuInfo querySkuOne(String configId);
SuperBomSkuInfo querySkuOne(String configId,String id);
List<SuperBomSkuInfo> getSkuInfo(SuperBomSkuInfo returnSkuInfo);
......
......@@ -59,6 +59,7 @@ public class CharacteristicValueExportDto implements Serializable{
*/
@FieldNameMapping(name = "isState", value = "是否可卖")
private String isState;
private String superBomIsState;
/**
* ZPHCode
......
......@@ -42,7 +42,7 @@ public interface IntegrateService {
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
Object querySkuOne(String configId);
Object querySkuOne(String configId,String id);
Object getToken(UserInfo userinfo);
......
......@@ -2,7 +2,11 @@ package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.CharacteristicMapper;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.mapper.SuperBomPriceCalculateMapper;
import cn.com.uitech.authorization.pojo.dto.CharacteristicExportDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicLogOpera;
import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.GetProductOutDto;
import cn.com.uitech.authorization.pojo.entity.Characteristic;
import cn.com.uitech.authorization.service.CharacteristicService;
import cn.com.uitech.authorization.service.CtoBomService;
......@@ -31,7 +35,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.text.ParseException;
......@@ -48,6 +51,9 @@ public class CharacteristicServiceImpl implements CharacteristicService {
@Resource
private CharacteristicMapper characteristicMapper;
@Resource
private SuperBomPriceCalculateMapper superBomPriceCalculateMapper;
@Autowired
private CtoBomService ctoBomService;
......@@ -153,13 +159,7 @@ public class CharacteristicServiceImpl implements CharacteristicService {
@Override
public void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response) throws ParseException, IOException {
//根据页面输入框查询要导出的数据
Date date = DateUitl.getNowAll();
String format = DateUitl.format(date, "yyyy-MM-dd");
String[] split = format.split("-");
StringBuilder worktableTitle = new StringBuilder();
for (String string : split) {
worktableTitle.append(string);
}
String file = "";
List<CharacteristicExportDto> priceModelList = new ArrayList<>();
List<CharacteristicExportDto> excelDtos = new ArrayList<>();
......@@ -167,9 +167,10 @@ public class CharacteristicServiceImpl implements CharacteristicService {
//根据页面输入框查询要导出的数据
priceModelList = characteristicMapper.exportCharacteristic(dto);
String superBomName = superBomPriceCalculateMapper.getSuperBomName(dto.getSuperBomCode());
excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos);
file = dto.getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征信息" + ".xls";
file = dto.getSuperBomCode() + superBomName + "特征信息" + ".xls";
String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
......
......@@ -2,6 +2,7 @@ package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.CharacteristicValueMapper;
import cn.com.uitech.authorization.mapper.SuperBomPriceCalculateMapper;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.pojo.entity.CharacteristicValue;
import cn.com.uitech.authorization.pojo.entity.OdRelation;
......@@ -35,6 +36,7 @@ import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import tk.mybatis.mapper.entity.Condition;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -53,6 +55,9 @@ import java.util.*;
@Transactional(rollbackFor = Exception.class)
public class CharacteristicValueServiceImpl implements CharacteristicValueService {
@Resource
private SuperBomPriceCalculateMapper superBomPriceCalculateMapper;
@Autowired
private CharacteristicValueMapper characteristicValueMapper;
......@@ -225,13 +230,7 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
public void exportCharacteristicValue(CharacteristicValueRequestParamDto dto, HttpServletResponse response) {
//根据页面输入框查询要导出的数据
try {
Date date = DateUitl.getNowAll();
String format = DateUitl.format(date, "yyyy-MM-dd");
String[] split = format.split("-");
StringBuilder worktableTitle = new StringBuilder();
for (String string : split) {
worktableTitle.append(string);
}
String file = "";
List<CharacteristicValueExportDto> priceModelList = new ArrayList<>();
List<CharacteristicValueExportDto> excelDtos = new ArrayList<>();
......@@ -239,9 +238,10 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
//根据页面输入框查询要导出的数据
priceModelList = characteristicValueMapper.exportCharacteristicValue(dto);
String superBomName = superBomPriceCalculateMapper.getSuperBomName(dto.getSuperBomCode());
excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos);
file = dto.getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征值信息" + ".xls";
file = dto.getSuperBomCode() + superBomName + "特征值信息" + ".xls";
String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
......
......@@ -752,9 +752,9 @@ public class IntegrateServiceImpl implements IntegrateService {
* @Param [configId]
* @return java.lang.Object
**/
public Object querySkuOne(String configId) {
public Object querySkuOne(String configId,String id) {
return superBomSkuInfoMapper.querySkuOne(configId);
return superBomSkuInfoMapper.querySkuOne(configId,id);
}
@Override
......@@ -931,7 +931,7 @@ public class IntegrateServiceImpl implements IntegrateService {
toPLMDto.setOptionChoiceMaps(maps);
HttpHeaders headers = getHttpHeaderPlm(nonce);
HttpEntity httpEntity = new HttpEntity<>(JSONObject.toJSON(toPLMDto), headers);
characteristicMapper.saveAppluOpera(httpEntity.toString(), request.getHeader("UserCode"), plmUrl);
characteristicMapper.saveApplyOpera(httpEntity.toString(), request.getHeader("UserCode"), plmUrl);
restTemplate.setErrorHandler(new CustomResponseErrorHandler());
map = (Map<String, Object>) restTemplate.exchange(plmUrl, HttpMethod.POST, httpEntity, Object.class).getBody();
Integer code = (Integer) map.get("code");
......@@ -1326,6 +1326,7 @@ public class IntegrateServiceImpl implements IntegrateService {
}
}
}
characteristicMapper.saveApplyOpera(configSkuInfo.toString(),request.getHeader("UserCode"),"H3C-撞配");
return configSkuInfo;
}
......
......@@ -265,13 +265,6 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
public void exportCharacteristicValuePrice(CharacteristicValueExportDto dto, HttpServletResponse response) {
try {
Date date = DateUitl.getNowAll();
String format = DateUitl.format(date, "yyyy-MM-dd");
String[] split = format.split("-");
StringBuilder worktableTitle = new StringBuilder();
for (String string : split) {
worktableTitle.append(string);
}
String file = "";
List<SuperCharacterPriceInfoDto> priceModelList = new ArrayList<>();
List<SuperCharacterPriceInfoDto> excelDtos = new ArrayList<>();
......@@ -279,42 +272,10 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
//根据页面输入框查询要导出的数据
priceModelList = superBomPriceCalculateMapper.exportCharacteristicValuePrice(dto);
if (ObjectUtils.isEmpty(priceModelList)) {
BasicsPriceInfoEntity basicsPriceInfoEntity = new BasicsPriceInfoEntity();
basicsPriceInfoEntity.setSuperBomCode(dto.getSuperBomCode());
basicsPriceInfoEntity.setBrand(dto.getBrand());
basicsPriceInfoEntity.setProductClassCode(dto.getProductClassCode());
basicsPriceInfoEntity.setPriceType(1);
BasicsPriceInfoEntity basicsPriceInfo;
basicsPriceInfo = superBomPriceCalculateMapper.getBasicsPriceInfo(basicsPriceInfoEntity);
if (ObjectUtils.isEmpty(basicsPriceInfo) && !StringUtils.isEmpty(basicsPriceInfoEntity.getSuperBomCode())) {
basicsPriceInfoEntity.setSuperBomCode(null);
basicsPriceInfo = superBomPriceCalculateMapper.getBasicsPriceInfo(basicsPriceInfoEntity);
if (ObjectUtils.isEmpty(basicsPriceInfo)) {
basicsPriceInfoEntity.setPriceType(2);
basicsPriceInfo = superBomPriceCalculateMapper.getBasicsPriceInfo(basicsPriceInfoEntity);
if (ObjectUtils.isEmpty(basicsPriceInfo) && !StringUtils.isEmpty(basicsPriceInfoEntity.getSuperBomCode())) {
basicsPriceInfoEntity.setSuperBomCode(null);
basicsPriceInfo = superBomPriceCalculateMapper.getBasicsPriceInfo(basicsPriceInfoEntity);
if (ObjectUtils.isEmpty(basicsPriceInfo)) {
throw new BusinessException(HttpStatus.INTERNAL_SERVER_ERROR.value(), "请维护价格系数!");
}
}
}
}
for (SuperCharacterPriceInfoDto superCharacterPriceInfoDto : priceModelList) {
if (basicsPriceInfo.getPriceType().equals(1)) {
superCharacterPriceInfoDto.setPriceType("成本定价法");
} else {
superCharacterPriceInfoDto.setPriceType("市场定价法");
}
}
}
String superBomName = superBomPriceCalculateMapper.getSuperBomName(dto.getSuperBomCode());
excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos);
file = priceModelList.get(0).getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征值价格信息" + ".xls";
file = dto.getSuperBomCode() + superBomName + "特征值价格信息" + ".xls";
String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
response.setContentType("APPLICATION/OCTET-STREAM");
......
......@@ -263,6 +263,15 @@
<if test="characteristicCode!=null and characteristicCode!=''">
AND a.characteristic_code=#{characteristicCode}
</if>
<if test="plmName!=null and plmName!=''">
and a.characteristic_name like CONCAT('%','${plmName}','%')
</if>
<if test="unisSalesCName!=null and unisSalesCName!=''">
and a.unis_sales_c_name LIKE CONCAT('%','${unisSalesCName}','%')
</if>
<if test="isH3C!=null ">
AND a.is_h3c=#{isH3C}
</if>
</where>
order by sort asc
</select>
......@@ -283,7 +292,7 @@
);
</insert>
<insert id="saveAppluOpera">
<insert id="saveApplyOpera">
insert into apply_log_opera (
url
,param
......
......@@ -192,7 +192,7 @@
and a.Characteristic_Code=#{characteristicCode}
</if>
<if test="characteristicValueCode!=null and characteristicValueCode!=''">
and a.Characteristic_Value_Code = #{characteristicValueCode}
and a.Characteristic_Value_Code like CONCAT('%','${characteristicValueCode}','%')
</if>
<if test="superBomCode!=null and superBomCode!=''">
and a.super_bom_code=#{superBomCode}
......@@ -200,6 +200,15 @@
<if test="brand!=null and brand!=''">
and c.brand = #{brand}
</if>
<if test="plmName!=null and plmName!=''">
and a.Characteristic_Value_name like CONCAT('%','${plmName}','%')
</if>
<if test="unisSalesVName!=null and unisSalesVName!=''">
and a.unis_Sales_V_Name like CONCAT('%','${unisSalesVName}','%')
</if>
<if test="isH3C!=null ">
and a.is_h3c = #{isH3C}
</if>
</where>
order by b.sort asc
</select>
......
......@@ -175,6 +175,9 @@
<if test="characteristicValueCode != null and characteristicValueCode != ''.toString()">
and c.characteristic_value_code like CONCAT('%','${characteristicValueCode}','%')
</if>
<if test="characteristicValueName != null and characteristicValueName != ''.toString()">
and c.characteristic_value_name like CONCAT('%','${characteristicValueName}','%')
</if>
<if test="characteristicCode != null and characteristicCode != ''.toString()">
and b.characteristic_code = #{characteristicCode}
</if>
......@@ -184,6 +187,12 @@
<if test="productClassCode != null and productClassCode != ''.toString()">
and a.product_class_code = #{productClassCode}
</if>
<if test="isState != null">
and c.is_state = #{isState}
</if>
<if test="superBomIsState != null ">
and a.is_state = #{superBomIsState}
</if>
</where>
order by b.sort asc
</select>
......@@ -243,4 +252,8 @@
#{leve2Price},#{leve3Price},#{leve4Price},#{agentPrice},#{updateUser},now(),#{opera}
)
</insert>
<select id="getSuperBomName" resultType="java.lang.String">
select super_bom_name from super_bom_info where super_bom_code = #{superBomCode}
</select>
</mapper>
......@@ -166,7 +166,7 @@
</resultMap>
<select id="querySkuOne" resultMap="SuperBomSkuMap">
select * from super_bom_sku_info a left join super_bom_sku_config_info b on a.config_id = b.config_id
where a.config_id = #{configId}
where a.config_id = #{configId} and a.id = #{id}
</select>
<select id="getSkuInfo" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo">
......@@ -201,7 +201,7 @@
</if>
apply_user = #{applyUser} ,
apply_time = now()
where config_id = #{configId}
where config_id = #{configId} and id = #{id}
</update>
<update id="updateSkuStatusH3c">
......
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