This commit is contained in:
parent
f68a0c3a25
commit
f607dcacaa
|
|
@ -173,4 +173,6 @@ public interface PurchaseMapper {
|
||||||
int getJsData(@Param("planId") String planId);
|
int getJsData(@Param("planId") String planId);
|
||||||
|
|
||||||
int deleteDetail(Long id);
|
int deleteDetail(Long id);
|
||||||
|
|
||||||
|
int updateDetail(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,7 @@ public class PurchaseServiceImpl implements PurchaseService {
|
||||||
public AjaxResult deleteDetail(Long id) {
|
public AjaxResult deleteDetail(Long id) {
|
||||||
try {
|
try {
|
||||||
int i = mapper.deleteDetail(id);
|
int i = mapper.deleteDetail(id);
|
||||||
|
mapper.updateDetail(id);
|
||||||
return i > 0 ? AjaxResult.success("撤销成功") : AjaxResult.error();
|
return i > 0 ? AjaxResult.success("撤销成功") : AjaxResult.error();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
log.warn("单元格为空");
|
log.warn("单元格为空");
|
||||||
data.setTimes("");
|
data.setTimes("");
|
||||||
}
|
}
|
||||||
data.setRemarks(row.getCell(7).getStringCellValue()); //备注
|
data.setRemarks(getCellStringValue(row.getCell(7)));//备注
|
||||||
dataList.add(data);
|
dataList.add(data);
|
||||||
}
|
}
|
||||||
workbook.close();
|
workbook.close();
|
||||||
|
|
@ -267,6 +267,34 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
return ServerResponse.createError("导入失败,请检查表格数据",dataList);
|
return ServerResponse.createError("导入失败,请检查表格数据",dataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCellStringValue(Cell cell) {
|
||||||
|
if (cell == null) return "";
|
||||||
|
switch (cell.getCellType()) {
|
||||||
|
case STRING:
|
||||||
|
return cell.getStringCellValue().trim();
|
||||||
|
case NUMERIC:
|
||||||
|
// 如果是整数,避免小数点
|
||||||
|
double value = cell.getNumericCellValue();
|
||||||
|
if (value == (long) value) {
|
||||||
|
return String.valueOf((long) value);
|
||||||
|
} else {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
case BOOLEAN:
|
||||||
|
return String.valueOf(cell.getBooleanCellValue());
|
||||||
|
case FORMULA:
|
||||||
|
try {
|
||||||
|
return cell.getStringCellValue();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
return String.valueOf(cell.getNumericCellValue());
|
||||||
|
}
|
||||||
|
case BLANK:
|
||||||
|
return "";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static String getCode(int num) {
|
private static String getCode(int num) {
|
||||||
num++;
|
num++;
|
||||||
String year = DateTimeHelper.getNowYMD();
|
String year = DateTimeHelper.getNowYMD();
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
<delete id="deleteDetail">
|
<delete id="deleteDetail">
|
||||||
delete
|
delete
|
||||||
from st_plan_apply
|
from st_plan_out
|
||||||
WHERE id = #{id}
|
WHERE apply_id=#{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<!--查询详情数据-->
|
<!--查询详情数据-->
|
||||||
|
|
@ -71,6 +71,13 @@
|
||||||
<update id="updatePlanData">
|
<update id="updatePlanData">
|
||||||
update st_plan_apply set ck_num=#{cgNum},lk_num=#{lkNum},fh_day=#{fhDay} where id=#{planId}
|
update st_plan_apply set ck_num=#{cgNum},lk_num=#{lkNum},fh_day=#{fhDay} where id=#{planId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateDetail">
|
||||||
|
update st_plan_apply
|
||||||
|
set ck_num=0,
|
||||||
|
lk_num=0,
|
||||||
|
fh_day=null
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<select id="getProPurchaseList" resultType="com.bonus.aqgqj.business.backstage.entity.PurchaseVo">
|
<select id="getProPurchaseList" resultType="com.bonus.aqgqj.business.backstage.entity.PurchaseVo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue