|
|
@@ -6,6 +6,9 @@ import com.jpsoft.employment.modules.base.service.LabourServicesService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.User;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -27,12 +30,19 @@ public class LabourServicesController {
|
|
|
@Autowired
|
|
|
private LabourServicesService labourServicesService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<LabourServices> create(){
|
|
|
MessageResult<LabourServices> msgResult = new MessageResult<>();
|
|
|
|
|
|
LabourServices labourServices = new LabourServices();
|
|
|
+ labourServices.setType("1");
|
|
|
|
|
|
msgResult.setData(labourServices);
|
|
|
msgResult.setResult(true);
|
|
|
@@ -50,6 +60,8 @@ public class LabourServicesController {
|
|
|
labourServices.setDelFlag(false);
|
|
|
labourServices.setCreateBy(subject);
|
|
|
labourServices.setCreateTime(new Date());
|
|
|
+ labourServices.setStatus("0");
|
|
|
+ labourServices.setApprovalStatus("1");
|
|
|
|
|
|
int affectCount = labourServicesService.insert(labourServices);
|
|
|
|
|
|
@@ -196,7 +208,7 @@ public class LabourServicesController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String id,
|
|
|
+ String approvalStatus,String approveTimeRange,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
@@ -209,14 +221,53 @@ public class LabourServicesController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(approvalStatus)) {
|
|
|
+ searchParams.put("approvalStatus",approvalStatus);
|
|
|
}
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(approveTimeRange)) {
|
|
|
+ String[] timeRangeArray = approveTimeRange.split(",");
|
|
|
+ String beginTime = "";
|
|
|
+ String endTime = "";
|
|
|
+ beginTime+=" 00:00:00";
|
|
|
+ if (timeRangeArray.length == 1) {
|
|
|
+ beginTime = timeRangeArray[0];
|
|
|
+ } else if (timeRangeArray.length == 2) {
|
|
|
+ beginTime = timeRangeArray[0];
|
|
|
+ endTime = timeRangeArray[1];
|
|
|
+ beginTime+=" 00:00:00";
|
|
|
+ endTime+=" 23:59:59";
|
|
|
+ }
|
|
|
+
|
|
|
+ searchParams.put("beginTime", beginTime);
|
|
|
+ searchParams.put("endTime", endTime);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
Page<LabourServices> page = labourServicesService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
+ for (LabourServices labourServices:page) {
|
|
|
+
|
|
|
+ String typeN = dataDictionaryService.findNameByCatalogNameAndValue("劳务对接类型",labourServices.getType());
|
|
|
+
|
|
|
+ labourServices.setTypeN(typeN);
|
|
|
+
|
|
|
+ String approvalStatusN = dataDictionaryService.findNameByCatalogNameAndValue("劳务对接审批状态",labourServices.getApprovalStatus());
|
|
|
+
|
|
|
+ labourServices.setApprovalStatusN(approvalStatusN);
|
|
|
+
|
|
|
+ User user = userService.get(labourServices.getApprovePersonId());
|
|
|
+
|
|
|
+ if(user!=null) {
|
|
|
+ labourServices.setApprovePersonName(user.getRealName());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|