forked from integrated_whb/integrated_whb
parent
9fc2b68dc2
commit
ae5bcebb97
|
@ -102,7 +102,8 @@ public class AppTrafficSafetyMeetingController extends BaseController {
|
||||||
//修改
|
//修改
|
||||||
@RequestMapping(value = "/edit")
|
@RequestMapping(value = "/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object edit(@RequestParam(value="livePhoto",required=false) MultipartFile file) throws Exception {
|
public Object edit(@RequestParam(value="livePhoto",required=false) MultipartFile livePhoto,
|
||||||
|
@RequestParam(value="signPhoto", required=false) MultipartFile signPhoto) throws Exception {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = this.getPageData();
|
PageData pd = this.getPageData();
|
||||||
|
@ -112,20 +113,29 @@ public class AppTrafficSafetyMeetingController extends BaseController {
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
|
||||||
pd.put("TRANSPORTATIONCOMPANY", Jurisdiction.getCORPINFO_ID()); // 经营企业
|
pd.put("TRANSPORTATIONCOMPANY", Jurisdiction.getCORPINFO_ID()); // 经营企业
|
||||||
|
|
||||||
String ffile = DateUtil.getDays();
|
if (livePhoto != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))){
|
||||||
if (file != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))){
|
String livePhotoPath = saveFile(livePhoto, pd);
|
||||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
if (livePhotoPath != null) {
|
||||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) {
|
pd.put("LIVEPHOTOS", livePhotoPath);
|
||||||
|
} else {
|
||||||
errInfo = "fail";
|
errInfo = "fail";
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
map.put("msg", "文件格式不正确!");
|
map.put("msg", "实时照片文件格式不正确或保存失败!");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对于signPhoto的处理
|
||||||
|
if (signPhoto != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))){
|
||||||
|
String signPhotoPath = saveFile(signPhoto, pd);
|
||||||
|
if (signPhotoPath != null) {
|
||||||
|
pd.put("SIGNATUREPICTURE", signPhotoPath);
|
||||||
|
} else {
|
||||||
|
errInfo = "fail";
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "签字图片文件格式不正确或保存失败!");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
|
||||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile);
|
|
||||||
pd.put("LIVEPHOTOS", Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile + "/" + fileName);
|
|
||||||
pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME"));
|
|
||||||
pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meetingRecipienService.edit(pd);
|
meetingRecipienService.edit(pd);
|
||||||
|
@ -134,5 +144,17 @@ public class AppTrafficSafetyMeetingController extends BaseController {
|
||||||
map.put("pd", pd);
|
map.put("pd", pd);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
private String saveFile(MultipartFile file, PageData pd) throws Exception {
|
||||||
|
String ffile = DateUtil.getDays(), fileName = null;
|
||||||
|
if (file != null) {
|
||||||
|
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||||
|
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||||
|
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile);
|
||||||
|
return Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile + "/" + fileName;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,4 +147,17 @@ public class TrafficSecurityCommitmentController extends BaseController {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//详情
|
||||||
|
@RequestMapping(value="/goEdit")
|
||||||
|
@ResponseBody
|
||||||
|
public Object goEdit() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd = securityCommitmentService.findById(pd); //根据ID读取
|
||||||
|
map.put("pd", pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,5 @@ public interface TrafficSecurityCommitmentMapper {
|
||||||
|
|
||||||
void edit(PageData pd);
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
PageData findById(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,4 +12,5 @@ public interface TrafficSecurityCommitmentService {
|
||||||
|
|
||||||
List<PageData> listForSecurityStaffing(Page page);
|
List<PageData> listForSecurityStaffing(Page page);
|
||||||
|
|
||||||
|
PageData findById(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,9 @@ public class TrafficSecurityCommitmentServiceImpl implements TrafficSecurityComm
|
||||||
public List<PageData> listForSecurityStaffing(Page page) {
|
public List<PageData> listForSecurityStaffing(Page page) {
|
||||||
return securityCommitmentMapper.datalistPage(page);
|
return securityCommitmentMapper.datalistPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData findById(PageData pd) {
|
||||||
|
return securityCommitmentMapper.findById(pd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
f.OPERATORNAME = #{OPERATORNAME},
|
f.OPERATORNAME = #{OPERATORNAME},
|
||||||
f.OPERATTIME = #{OPERATTIME},
|
f.OPERATTIME = #{OPERATTIME},
|
||||||
f.SIGNATUREPICTURE = #{SIGNATUREPICTURE},
|
f.SIGNATUREPICTURE = #{SIGNATUREPICTURE},
|
||||||
f.LIVEPHOTOS = #{LIVEPHOTOS},
|
f.LIVEPHOTOS = IF(#{LIVEPHOTOS} IS NOT NULL AND #{LIVEPHOTOS} != '', #{LIVEPHOTOS}, f.LIVEPHOTOS),
|
||||||
f.ATTENDANCE_STATUS = #{ATTENDANCE_STATUS},
|
f.ATTENDANCE_STATUS = #{ATTENDANCE_STATUS},
|
||||||
f.LOCATIONADDRESS = #{LOCATIONADDRESS},
|
f.LOCATIONADDRESS = #{LOCATIONADDRESS},
|
||||||
f.LATITUDE = #{LATITUDE},
|
f.LATITUDE = #{LATITUDE},
|
||||||
|
|
|
@ -149,4 +149,13 @@
|
||||||
where u.ISDELETE = '0'
|
where u.ISDELETE = '0'
|
||||||
and u.ISMAIN != '1'
|
and u.ISMAIN != '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findById" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.SECURITYCOMMITMENT_ID = #{SECURITYCOMMITMENT_ID}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -157,6 +157,6 @@
|
||||||
from
|
from
|
||||||
<include refid="tableName"></include> f
|
<include refid="tableName"></include> f
|
||||||
where
|
where
|
||||||
f.STAFFING_ID = #{STAFFING_ID}
|
f.LABORCONTRACT_ID = #{LABORCONTRACT_ID}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue