BUG修改

This commit is contained in:
haozq 2024-11-16 16:53:04 +08:00
parent 41fb2ae361
commit 44b3f74168
5 changed files with 42 additions and 30 deletions

View File

@ -164,17 +164,14 @@ public class PartApplyAppServiceImp {
*/
public ServerResponse uploadImage(HttpServletRequest request) {
try{
String id=request.getParameter("params");
String bast64s=request.getParameter("bast64");
List<String> files=JSON.parseArray(bast64s,String.class);
if(StringHelper.isEmpty(id)){
return ServerResponse.createErroe("请选择申请记录");
}
if(files==null || files.size()<1){
String id=request.getParameter("recordId");
String bast64=request.getParameter("bast64");
if(StringHelper.isEmpty(bast64)){
return ServerResponse.createErroe("请先上传文件");
}
List<FileUploadVo> fileList=uploadService.uploadImageBast64(files,id,"t_part_apply","使用照片");
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.size()){
List<FileUploadVo> fileList=uploadService.uploadImageBast64(bast64,id,"t_part_apply","使用照片");
if(StringUtils.isEmpty(fileList) || fileList.size()<1){
return ServerResponse.createErroe("文件上传失败");
}
return ServerResponse.createSuccess("文件上传成功","文件上传成功");

View File

@ -72,14 +72,14 @@ public class PartApplyServiceImpl implements PartApplyService{
String infoMsg = String.join(",", info);
vo.setInfoMsg(infoMsg);
//图片转换
String bast641=transBast64(vo.getLyUrl());
String bast642=transBast64(vo.getCkUrl());
String bast643=transBast64(vo.getShUrl());
String bast644=transBast64(vo.getZdUrl());
vo.setLyUrl(bast641);
vo.setCkUser(bast642);
vo.setShUrl(bast643);
vo.setZdUrl(bast644);
// String bast641=transBast64(vo.getLyUrl());
// String bast642=transBast64(vo.getCkUrl());
// String bast643=transBast64(vo.getShUrl());
// String bast644=transBast64(vo.getZdUrl());
// vo.setLyUrl(bast641);
// vo.setCkUser(bast642);
// vo.setShUrl(bast643);
// vo.setZdUrl(bast644);
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_apply",null);
vo.setFileList(flieList);
return ServerResponse.createSuccess(vo);

View File

@ -37,10 +37,9 @@ public class FileUploadService {
public List<FileUploadVo> uploadImageBast64(List<String> files , String outId, String table,String type){
public List<FileUploadVo> uploadImageBast64(String bast64, String outId, String table,String type){
List<FileUploadVo> list=new ArrayList<>();
try {
for (String bast64 : files) {
String fileName=IDUtils.createID()+".png";
String filePath= "/"+DateTimeHelper.getNowYMD()+"/"+ fileName;
String newPath= SystemUtils.getUploadPath()+filePath;
@ -68,7 +67,6 @@ public class FileUploadService {
}
list.add(vo);
mapper.insertFileUpload(vo);
}
}catch (Exception e){
log.error(e.toString(),e);
}

View File

@ -5,9 +5,25 @@
<insert id="addPartApply" useGeneratedKeys="true" keyProperty="id">
INSERT INTO t_part_apply(
code, creator, user_name, create_time, type, remark, status, updater,
update_time, dev_id,dev_code, dev_type, pro_id, pro_name,
apply_num,status_type)values(
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),#{deviceId},#{devCode}, #{devType},#{proId},#{proName}
update_time,
<if test="deviceId!=null and deviceId!=''">
dev_id,
</if>
dev_code, dev_type,
<if test="proId!=null and proId!=''">
pro_id ,
</if>
pro_name,
apply_num,status_type)values(
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),
<if test="deviceId!=null and deviceId!=''">
#{deviceId},
</if>
#{devCode}, #{devType},
<if test="proId!=null and proId!=''">
#{proId},
</if>
#{proName}
,#{applyNum},#{statusType})
</insert>
<!--差人申请详情-->

View File

@ -69,20 +69,21 @@
</select>
<!--以工程为维度查询领料单详情-->
<select id="getProDetailsPage" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
select pad.part_id partId,pad.part_type partType,pad.part_name partName,pad.part_model partModel,pad.part_unit partUnit,
sum(pad.apply_num) applyNum,pt.price,sum(pad.apply_num*pt.price) money
select pad.part_id partId, ANY_VALUE(pad.part_type) partType,ANY_VALUE(pad.part_name) partName,
ANY_VALUE(pad.part_model) partModel,ANY_VALUE(pad.part_unit) partUnit,ANY_VALUE(tpa.remark) remark ,
ANY_VALUE(sum(pad.apply_num)) applyNum,ANY_VALUE(pt.price) price ,ANY_VALUE(sum(pad.apply_num*pt.price)) money
from t_part_apply tpa
LEFT JOIN t_part_apply_details pad on pad.apply_id=tpa.id
left join pa_type pt on pad.part_id=pt.id
LEFT JOIN t_part_apply_details pad on pad.apply_id=tpa.id
left join pa_type pt on pad.part_id=pt.id
where tpa.`status`=4 and tpa.pro_id=#{proId}
<if test="partType!=null and partType !=''">
and tpa.part_type like concat('%',#{partType},'%')
and pad.part_type like concat('%',#{partType},'%')
</if>
<if test="partName!=null and partName !=''">
and tpa.part_name like concat('%',#{partName},'%')
and pad.part_name like concat('%',#{partName},'%')
</if>
<if test="partModel!=null and partModel !=''">
and tpa.part_model like concat('%',#{partModel},'%')
and pad.part_model like concat('%',#{partModel},'%')
</if>
GROUP BY pad.part_id
</select>