合并分支 'fix_2nd_period' 到 'master'

Fix 2nd period

查看合并请求 laws-nio/laws-weilai!272
This commit is contained in:
高嵩
2023-01-03 13:57:52 +08:00
4 changed files with 96 additions and 13 deletions
@@ -1271,21 +1271,21 @@ public class WordUtil {
text = "Final"; text = "Final";
} }
for (String value : itemText.split(",")) { for (String value : itemText.split(",")) {
String blank = getBlank(value); String blank = getBlank(value);
if (text.contains(value)) { if(StringUtils.isNotEmpty(text)){
if (text.equals("if fitted") && value.equals("Mandatory")) { int count = 0 ;
sb.append("□" + value + blank); for (String s : text.split(",")) {
} else { if(s.equals(value)){
//将错误的英文转为正确的 count ++;
String value1 = scopeConvert(value); }
}
String value1 = scopeConvert(value);
if(count == 0){
sb.append("□" + value1 + blank);
}else{
sb.append("■" + value1 + blank); sb.append("■" + value1 + blank);
} }
} else {
String value1 = scopeConvert(value);
sb.append("□" + value1 + blank);
} }
} }
String[] split = sb.toString().split("\r\n"); String[] split = sb.toString().split("\r\n");
@@ -40,9 +40,17 @@ public interface FileSplitItemsEOMapper extends BaseMapper<SarFileSplitItemsEO>
* @param condition * @param condition
* @return * @return
*/ */
List<Map<String, Object>> getInfoList(@Param("field") String field, List<SarFileSplitItemsEO> getInfoList(@Param("field") String field,
@Param("condition") String condition); @Param("condition") String condition);
/**
* 根据条件查询总数
* @param
* @param condition
* @return
*/
Integer getInfoCount(@Param("condition") String condition);
/** /**
* 根据id查询 * 根据id查询
* @param value * @param value
@@ -69,4 +77,6 @@ public interface FileSplitItemsEOMapper extends BaseMapper<SarFileSplitItemsEO>
int insertForeach(List<SarFileSplitItemsEO> list); int insertForeach(List<SarFileSplitItemsEO> list);
List<SarFileSplitItemsEO> selectByInfoId(String value); List<SarFileSplitItemsEO> selectByInfoId(String value);
void updateSarFileSplitItemsInfo(@Param("sarFileSplitItemsEO") SarFileSplitItemsEO sarFileSplitItemsEO);
} }
@@ -16,12 +16,19 @@
</select> </select>
<!--列表--> <!--列表-->
<select id="getInfoList" resultType="java.util.LinkedHashMap"> <select id="getInfoList" resultType="com.jero.modules.split.entity.SarFileSplitItemsEO">
select ${field} select ${field}
from sar_file_split_items from sar_file_split_items
${condition} ${condition}
</select> </select>
<!--列表-->
<select id="getInfoCount" resultType="integer">
select count(1)
from sar_file_split_items
${condition}
</select>
<!--根据id查询--> <!--根据id查询-->
<select id="selectByPrimaryKey" resultType="java.util.LinkedHashMap"> <select id="selectByPrimaryKey" resultType="java.util.LinkedHashMap">
select * select *
@@ -123,4 +130,16 @@
from sar_file_split_items from sar_file_split_items
where info_id = #{value} where info_id = #{value}
</select> </select>
<update id="updateSarFileSplitItemsInfo" parameterType="java.util.List">
update sar_file_split_items
<set >
<if test="sarFileSplitItemsEO.zhan3Shi4Shun4Xu4 != null" >
zhan3_shi4_shun4_xu4 = #{sarFileSplitItemsEO.zhan3Shi4Shun4Xu4},
</if>
modify_user = #{sarFileSplitItemsEO.modifyUser, jdbcType=VARCHAR},
modify_time = #{sarFileSplitItemsEO.modifyTime, jdbcType=TIMESTAMP}
</set>
where id = #{sarFileSplitItemsEO.id, jdbcType=VARCHAR}
</update>
</mapper> </mapper>
@@ -198,6 +198,11 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
public int updateItemContent(Map<String, Object> parameter) { public int updateItemContent(Map<String, Object> parameter) {
Map<String,Object> copyParameter = new HashMap<>();
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
copyParameter.put(entry.getKey(),entry.getValue());
}
this.setEditZhan3Shi4Shun4Xu4(copyParameter);
List<SarFileSplitItemsValEO> itemValEOList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList"); List<SarFileSplitItemsValEO> itemValEOList = (List<SarFileSplitItemsValEO>) parameter.get("itemValEOList");
List<SarFileSplitItemsValEO> getValList = new ArrayList<>(); List<SarFileSplitItemsValEO> getValList = new ArrayList<>();
for(Object object : itemValEOList) { for(Object object : itemValEOList) {
@@ -437,6 +442,55 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
return dao.insertInfo(insertField, insertValue); return dao.insertInfo(insertField, insertValue);
} }
/**
* 根据信息id更新排序字段
* @param parameter
*/
public void setEditZhan3Shi4Shun4Xu4(Map<String, Object> parameter){
String id = (String) parameter.get("id");
String info_id = (String) parameter.get("info_id");
Integer inputOrderNum = (Integer) parameter.get("zhan3_shi4_shun4_xu4");
if(inputOrderNum > 0){
String field = "id,items_num,items_name,zhan3_shi4_shun4_xu4";
String condition = " where info_id = '" + info_id + "' order by zhan3_shi4_shun4_xu4 asc";
List<SarFileSplitItemsEO> splitItems = this.dao.getInfoList(field, condition);
List<SarFileSplitItemsEO> updateList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(splitItems)){
Double zhan3Shi4Shun4Xu4 = Double.valueOf(splitItems.stream().filter(e -> StringUtils.equals(e.getId(), id))
.map(e -> e.getZhan3Shi4Shun4Xu4()).collect(Collectors.toList()).get(0));
Integer orderNumData = zhan3Shi4Shun4Xu4.intValue();
Integer infoCount = this.dao.getInfoCount(" where info_id = '" + info_id + "' and zhan3_shi4_shun4_xu4 = " + inputOrderNum);
//有重复展示顺序的,后面的号全+1
if (infoCount > 0 && !orderNumData.equals(inputOrderNum)) {
// 设置排序
String geField = "id,items_num,items_name,zhan3_shi4_shun4_xu4";
String geCondition = " where info_id = '" + info_id + "' and zhan3_shi4_shun4_xu4 >= " + inputOrderNum + " order by zhan3_shi4_shun4_xu4 asc ";
List<SarFileSplitItemsEO> geSplitItems = this.dao.getInfoList(geField, geCondition);
if(CollectionUtils.isNotEmpty(geSplitItems)){
for (int i = 0; i < geSplitItems.size(); i++) {
updateList.add(geSplitItems.get(i));
}
}
}
}
if(CollectionUtils.isNotEmpty(updateList)){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for (SarFileSplitItemsEO sarFileSplitItemsEO : updateList) {
int zhan3Shi4Shun4Xu4 = Double.valueOf(sarFileSplitItemsEO.getZhan3Shi4Shun4Xu4()).intValue() + 1;
sarFileSplitItemsEO.setZhan3Shi4Shun4Xu4(String.valueOf(zhan3Shi4Shun4Xu4));
sarFileSplitItemsEO.setModifyTime(new Date());
sarFileSplitItemsEO.setModifyUser(currentUser.getUsername());
this.dao.updateSarFileSplitItemsInfo(sarFileSplitItemsEO);
}
}
}
}
private String getMustValues(String id) { private String getMustValues(String id) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();