Commit d2cdffbd authored by 赵啸非's avatar 赵啸非

添加目录字段

parent 1e23e744
......@@ -48,3 +48,4 @@ CREATE TABLE `mortals_xhx_child_license` (
KEY `deptId` (`deptId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '行业许可子证' ROW_FORMAT = Dynamic;
ALTER TABLE mortals_xhx_child_license ADD COLUMN `resolutionValue` varchar(64) DEFAULT '' COMMENT '设备分辨率' AFTER resolution;
......@@ -7,6 +7,7 @@ import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.certificate.model.CertificateDocumentQuery;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService;
import com.mortals.xhx.module.device.model.DeviceEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -22,15 +23,11 @@ import com.mortals.xhx.module.child.service.ChildLicenseService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -48,8 +45,6 @@ import com.mortals.xhx.common.code.*;
@RequestMapping("child/license")
public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<ChildLicenseService, ChildLicenseEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private CertificateDocumentService certificateDocumentService;
......@@ -63,8 +58,8 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
this.addDict(model, "legalPersonName", LegalPersonNameEnum.getEnumMap());
this.addDict(model, "processStatus", ProcessStatusEnum.getEnumMap());
this.addDict(model,"documentId", certificateDocumentService.find(new CertificateDocumentQuery())
.stream().collect(Collectors.toMap(x->x.getId(),y->y.getDocumentName(),(o,n)->n)));
this.addDict(model, "documentId", certificateDocumentService.find(new CertificateDocumentQuery())
.stream().collect(Collectors.toMap(x -> x.getId(), y -> y.getDocumentName(), (o, n) -> n)));
super.init(model, context);
......@@ -78,11 +73,44 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
@Override
protected void doListAfter(ChildLicenseEntity query, List<ChildLicenseEntity> list, Context context) throws AppException {
list.forEach(item->{
list.forEach(item -> {
item.setFormContent("");
item.setFormStyleContent("");
});
super.doListAfter(query, list, context);
}
/**
* 子证联报
*/
@PostMapping(value = "report")
public String report(@RequestBody ChildLicenseEntity childLicenseEntity) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "联报";
try {
if (childLicenseEntity.newEntity()) throw new AppException("Id不能为空!");
ChildLicenseEntity sourceEntity = this.service.get(childLicenseEntity.getId());
if (ProcessStatusEnum.已处理.getValue() == sourceEntity.getProcessStatus())
throw new AppException("当前子证已经联报");
childLicenseEntity.setReportUserId(this.getContextUserId(getContext()));
childLicenseEntity.setReportUserName(this.getContext().getUser().getRealName());
childLicenseEntity.setReportTime(new Date());
childLicenseEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
this.service.update(childLicenseEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) {
log.error("子证联报异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
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