Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
config-server-api
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何熠
config-server-api
Commits
43598ab9
Commit
43598ab9
authored
Jan 12, 2022
by
zhaoxiaolei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updateLog
parent
f753a40a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
69 additions
and
72 deletions
+69
-72
IntegrateController.java
.../uitech/authorization/controller/IntegrateController.java
+3
-3
CharacteristicMapper.java
...com/uitech/authorization/mapper/CharacteristicMapper.java
+1
-1
SuperBomPriceCalculateMapper.java
...ch/authorization/mapper/SuperBomPriceCalculateMapper.java
+2
-0
SuperBomSkuInfoMapper.java
...om/uitech/authorization/mapper/SuperBomSkuInfoMapper.java
+1
-1
CharacteristicValueExportDto.java
.../authorization/pojo/dto/CharacteristicValueExportDto.java
+1
-0
IntegrateService.java
...cn/com/uitech/authorization/service/IntegrateService.java
+1
-1
CharacteristicServiceImpl.java
...authorization/service/impl/CharacteristicServiceImpl.java
+11
-10
CharacteristicValueServiceImpl.java
...rization/service/impl/CharacteristicValueServiceImpl.java
+8
-8
IntegrateServiceImpl.java
...tech/authorization/service/impl/IntegrateServiceImpl.java
+4
-3
SuperBomPriceCalculateServiceImpl.java
...ation/service/impl/SuperBomPriceCalculateServiceImpl.java
+2
-41
CharacteristicMapper.xml
src/main/resources/mapper/CharacteristicMapper.xml
+10
-1
CharacteristicValueMapper.xml
src/main/resources/mapper/CharacteristicValueMapper.xml
+10
-1
SuperBomPriceCalculateMapper.xml
src/main/resources/mapper/SuperBomPriceCalculateMapper.xml
+13
-0
SuperBomSkuInfoMapper.xml
src/main/resources/mapper/SuperBomSkuInfoMapper.xml
+2
-2
No files found.
src/main/java/cn/com/uitech/authorization/controller/IntegrateController.java
View file @
43598ab9
...
...
@@ -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"
)
...
...
src/main/java/cn/com/uitech/authorization/mapper/CharacteristicMapper.java
View file @
43598ab9
...
...
@@ -98,5 +98,5 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
void
saveLogOpera
(
CharacteristicLogOpera
logOpera
);
void
saveAppl
u
Opera
(
String
httpEntity
,
String
userCode
,
String
plmUrl
);
void
saveAppl
y
Opera
(
String
httpEntity
,
String
userCode
,
String
plmUrl
);
}
src/main/java/cn/com/uitech/authorization/mapper/SuperBomPriceCalculateMapper.java
View file @
43598ab9
...
...
@@ -57,4 +57,6 @@ public interface SuperBomPriceCalculateMapper {
Characteristics
getPriceByCode
(
String
superBomCode
,
String
characteristicCode
,
String
characteristicValueCode
);
void
saveLogOpera
(
CharacteristicsLogOpera
logOpera
);
String
getSuperBomName
(
String
superBomCode
);
}
src/main/java/cn/com/uitech/authorization/mapper/SuperBomSkuInfoMapper.java
View file @
43598ab9
...
...
@@ -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
);
...
...
src/main/java/cn/com/uitech/authorization/pojo/dto/CharacteristicValueExportDto.java
View file @
43598ab9
...
...
@@ -59,6 +59,7 @@ public class CharacteristicValueExportDto implements Serializable{
*/
@FieldNameMapping
(
name
=
"isState"
,
value
=
"是否可卖"
)
private
String
isState
;
private
String
superBomIsState
;
/**
* ZPHCode
...
...
src/main/java/cn/com/uitech/authorization/service/IntegrateService.java
View file @
43598ab9
...
...
@@ -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
);
...
...
src/main/java/cn/com/uitech/authorization/service/impl/CharacteristicServiceImpl.java
View file @
43598ab9
...
...
@@ -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
);
...
...
src/main/java/cn/com/uitech/authorization/service/impl/CharacteristicValueServiceImpl.java
View file @
43598ab9
...
...
@@ -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
);
...
...
src/main/java/cn/com/uitech/authorization/service/impl/IntegrateServiceImpl.java
View file @
43598ab9
...
...
@@ -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
.
saveAppl
u
Opera
(
httpEntity
.
toString
(),
request
.
getHeader
(
"UserCode"
),
plmUrl
);
characteristicMapper
.
saveAppl
y
Opera
(
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
;
}
...
...
src/main/java/cn/com/uitech/authorization/service/impl/SuperBomPriceCalculateServiceImpl.java
View file @
43598ab9
...
...
@@ -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"
);
...
...
src/main/resources/mapper/CharacteristicMapper.xml
View file @
43598ab9
...
...
@@ -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=
"saveAppl
u
Opera"
>
<insert
id=
"saveAppl
y
Opera"
>
insert into apply_log_opera (
url
,param
...
...
src/main/resources/mapper/CharacteristicValueMapper.xml
View file @
43598ab9
...
...
@@ -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>
...
...
src/main/resources/mapper/SuperBomPriceCalculateMapper.xml
View file @
43598ab9
...
...
@@ -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>
src/main/resources/mapper/SuperBomSkuInfoMapper.xml
View file @
43598ab9
...
...
@@ -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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment