Commit 8a8fb30c authored by fangxinjiang's avatar fangxinjiang

附件信息调整

parent 68fd3939
...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; ...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past; import javax.validation.constraints.Past;
import java.io.Serializable; import java.io.Serializable;
......
...@@ -162,8 +162,6 @@ public class FileUploadController { ...@@ -162,8 +162,6 @@ public class FileUploadController {
unitAtta.setAttaType(key.substring(key.lastIndexOf(point))); unitAtta.setAttaType(key.substring(key.lastIndexOf(point)));
} }
unitAtta.setCreateTime(LocalDateTime.now()); unitAtta.setCreateTime(LocalDateTime.now());
YifuUser user = SecurityUtils.getUser();
unitAtta.setCreateUser(null == user ? "" : user.getId().toString());
return unitAtta; return unitAtta;
} }
......
...@@ -184,7 +184,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -184,7 +184,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeLog.setEmpId(empId); tEmployeeLog.setEmpId(empId);
tEmployeeLog.setType(type); tEmployeeLog.setType(type);
tEmployeeLog.setProjectId(empProId); tEmployeeLog.setProjectId(empProId);
tEmployeeLog.setContent(content);
tEmployeeLogService.save(tEmployeeLog); tEmployeeLogService.save(tEmployeeLog);
} }
......
...@@ -100,6 +100,8 @@ public class ChecksUtil { ...@@ -100,6 +100,8 @@ public class ChecksUtil {
checkBankNo.setMessage(message); checkBankNo.setMessage(message);
checkBankNo.setRemark(getJsonElementValue(resJson.getAsJsonObject().get(ChecksConstants.REMARK))); checkBankNo.setRemark(getJsonElementValue(resJson.getAsJsonObject().get(ChecksConstants.REMARK)));
checkBankNo.setType(CommonConstants.ONE_STRING); checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setName(name);
checkBankNo.setIdNum(idNum);
} }
} else { } else {
// 记录错误日志,正式项目中请换成log打印 // 记录错误日志,正式项目中请换成log打印
......
...@@ -55,8 +55,8 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh ...@@ -55,8 +55,8 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
**/ **/
@Override @Override
public R<Map<String,TCheckMobile>> checkMobiles(String mobiles){ public R<Map<String,TCheckMobile>> checkMobiles(String mobiles){
R<Map<String,TCheckMobile>> mobileMapR; R<Map<String,TCheckMobile>> mobileMapR = null;
Map<String,TCheckMobile> checkMobileMap; Map<String,TCheckMobile> checkMobileMap = null;
Map<String,TCheckMobile> existMap = new HashMap<>(); Map<String,TCheckMobile> existMap = new HashMap<>();
if (Common.isNotNull(mobiles)){ if (Common.isNotNull(mobiles)){
List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING); List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING);
...@@ -68,28 +68,31 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh ...@@ -68,28 +68,31 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
.in(TCheckMobile::getMobile,mobileList) .in(TCheckMobile::getMobile,mobileList)
.eq(TCheckMobile::getStatus,CommonConstants.ONE_STRING)); .eq(TCheckMobile::getStatus,CommonConstants.ONE_STRING));
if (Common.isNotNull(checkMobiles)){ if (Common.isNotNull(checkMobiles)){
checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile,TCheckMobile -> TCheckMobile)); existMap = checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile,TCheckMobile -> TCheckMobile));
} }
mobileList.removeAll(existMap.values()); mobileList.removeAll(existMap.keySet());
//2.从远处端获取数据 //2.从远处端获取数据
mobileMapR = ChecksUtil.checkMobile(Common.ListToStr(mobileList,CommonConstants.COMMA_STRING),canCheckService.getCanCheck()); if (Common.isNotNull(mobileList)){
if (Common.isEmpty(mobileMapR) && Common.isEmpty(mobileMapR.getData())){ mobileMapR = ChecksUtil.checkMobile(Common.ListToStr(mobileList,CommonConstants.COMMA_STRING),canCheckService.getCanCheck());
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR)); if (Common.isEmpty(mobileMapR) || Common.isEmpty(mobileMapR.getData())){
} return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR)
checkMobileMap = mobileMapR.getData(); +(Common.isNotNull(mobileMapR)?mobileMapR.getMsg():CommonConstants.EMPTY_STRING));
if (Common.isNotNull(mobileList) && Common.isNotNull(checkMobileMap)){ }
TCheckMobile checkMobile = null; checkMobileMap = mobileMapR.getData();
for (String mobile:mobileList){ if (Common.isNotNull(mobileList) && Common.isNotNull(checkMobileMap)){
if (Common.isEmpty(checkMobileMap.get(mobile))){ TCheckMobile checkMobile = null;
checkMobile = new TCheckMobile(); for (String mobile:mobileList){
checkMobile.setType(CommonConstants.ONE_STRING); if (Common.isEmpty(checkMobileMap.get(mobile))){
checkMobile.setMobile(mobile); checkMobile = new TCheckMobile();
checkMobile.setStatus(CommonConstants.TEN_STRING); checkMobile.setType(CommonConstants.ONE_STRING);
checkMobile.setMessage(Common.isEmpty(mobileMapR)?MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR):mobileMapR.getMsg()); checkMobile.setMobile(mobile);
checkMobile.setChargesstatus(CommonConstants.ZERO_STRING); checkMobile.setStatus(CommonConstants.TEN_STRING);
checkMobile.setNumbertype(CommonConstants.EMPTY_STRING); checkMobile.setMessage(Common.isEmpty(mobileMapR)?MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR):mobileMapR.getMsg());
checkMobile.setArea(CommonConstants.EMPTY_STRING); checkMobile.setChargesstatus(CommonConstants.ZERO_STRING);
checkMobileMap.put(mobile,checkMobile); checkMobile.setNumbertype(CommonConstants.EMPTY_STRING);
checkMobile.setArea(CommonConstants.EMPTY_STRING);
checkMobileMap.put(mobile,checkMobile);
}
} }
} }
} }
...@@ -98,8 +101,13 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh ...@@ -98,8 +101,13 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
} }
if (Common.isNotNull(checkMobileMap)){ if (Common.isNotNull(checkMobileMap)){
this.saveBatch(checkMobileMap.values()); this.saveBatch(checkMobileMap.values());
}else {
checkMobileMap = new HashMap<>();
} }
checkMobileMap.putAll(existMap); checkMobileMap.putAll(existMap);
if (Common.isEmpty(mobileMapR)){
mobileMapR = new R<>();
}
mobileMapR.setData(checkMobileMap); mobileMapR.setData(checkMobileMap);
return mobileMapR; return mobileMapR;
} }
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
package com.yifu.cloud.plus.v1.yifu.common.core.constant; package com.yifu.cloud.plus.v1.yifu.common.core.constant;
import java.util.List;
/** /**
* @author lengleng * @author lengleng
* @date 2019/2/1 * @date 2019/2/1
...@@ -215,4 +217,5 @@ public interface CommonConstants { ...@@ -215,4 +217,5 @@ public interface CommonConstants {
**/ **/
public static final int EMPLOYEE_INIT_NO_START = 7; public static final int EMPLOYEE_INIT_NO_START = 7;
String SAVE_FAILED = "保存失败!"; String SAVE_FAILED = "保存失败!";
String RESULT_EMPTY = "获取结果为空";
} }
...@@ -154,4 +154,8 @@ public class Common { ...@@ -154,4 +154,8 @@ public class Common {
} }
return result; return result;
} }
public static <T> boolean isNotNull(Collection<T> obj) {
return null != obj && obj.size() > 0;
}
} }
...@@ -40,7 +40,10 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -40,7 +40,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -170,6 +173,25 @@ public class DictController { ...@@ -170,6 +173,25 @@ public class DictController {
return R.ok(sysDictItemService.pageItem(page, sysDictItem)); return R.ok(sysDictItemService.pageItem(page, sysDictItem));
} }
/**
* 获取所有字典数据
* @return
*/
@GetMapping("/item/getAllDictItem")
public R<Map<String, Object>> getSysDictItemPage() {
return sysDictItemService.getSysDictItemPage();
}
/**
* 通过id查询父级字典的字典值
* @param itemTypes
* @return R
*/
@SysLog("通过id查询父级字典的字典值")
@GetMapping("/getParentDictItemByTypes")
public R<Map<String, Object>> getParentDictItemByTypes(String itemTypes) {
return sysDictItemService.getParentDictItemByTypes(itemTypes);
}
/** /**
* 通过id查询字典项 * 通过id查询字典项
* @param id id * @param id id
......
...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; ...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 字典项 * 字典项
...@@ -57,4 +58,9 @@ public interface SysDictItemService extends IService<SysDictItem> { ...@@ -57,4 +58,9 @@ public interface SysDictItemService extends IService<SysDictItem> {
IPage<SysDictItem> pageItem(Page page, SysDictItem sysDictItem); IPage<SysDictItem> pageItem(Page page, SysDictItem sysDictItem);
R<Boolean> removeDictItemDiy(Long id); R<Boolean> removeDictItemDiy(Long id);
R<Map<String, Object>> getParentDictItemByTypes(String itemTypes);
R<Map<String, Object>> getSysDictItemPage();
} }
...@@ -146,6 +146,43 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi ...@@ -146,6 +146,43 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return R.ok(baseMapper.deleteById(id) > 0); return R.ok(baseMapper.deleteById(id) > 0);
} }
@Override
public R<Map<String, Object>> getParentDictItemByTypes(String itemTypes) {
if (Common.isEmpty(itemTypes)){
return R.failed(CommonConstants.RESULT_EMPTY);
}
Map<String, Object> resultMap = new HashMap<>();
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,Common.initStrToList(itemTypes,CommonConstants.COMMA_STRING))
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
extracted(allList, resultMap);
return R.ok(resultMap);
}
@Override
public R<Map<String, Object>> getSysDictItemPage() {
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
Map<String, Object> resultMap = new HashMap<>();
extracted(allList, resultMap);
return R.ok(resultMap);
}
private void extracted(List<SysDictItem> allList, Map<String, Object> resultMap) {
if (Common.isNotNull(allList)){
for (SysDictItem item : allList) {
String dictCode = item.getType();
if (resultMap.get(dictCode) == null) {
Map<String, Object> dictMap = new HashMap<String, Object>();
dictMap.put(item.getValue(), item.getLabel());
resultMap.put(dictCode, dictMap);
} else {
Map dictMap = (Map) resultMap.get(dictCode);
dictMap.put(item.getValue(), item.getLabel());
}
}
}
}
/** /**
* 构建查询的 wrapper * 构建查询的 wrapper
* @param sysDictItem 查询条件 * @param sysDictItem 查询条件
......
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